We've been switching out all of our htmldb_get calls for the preferred (and documented and supported!) apex.server.process method. This has worked well so far for invoking AJAX processes from JavaScript so long as the AJAX process in question has been a *Page* level process. However, when we attempt to consume an *Application* process, it just does not appear to be working.
For the examples below, we have two Application Items named PRS_PRODUCT_PROFILE_ID and PRS_PROFILE_OPERATION. We have an On Demand Application Process (*not* a page process!) named MAINTAIN_PRODUCT_PROFILE_2.
Here is the previous htmldb_get approach (which works fine):
function resynchronizeProductProfile(productProfileID)
{
var profileOperation = 'EDIT_PROFILE';
var ajaxRequest = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=MAINTAIN_PRODUCT_PROFILE_2',0);
ajaxRequest.add( 'PRS_PRODUCT_PROFILE_ID', productProfileID );
ajaxRequest.add( 'PRS_PROFILE_OPERATION', profileOperation );
var resynchronizeResult = ajaxRequest.get();
ajaxRequest = null;
return resynchronizeResult;
}
Here is the (what I think is the) same call using the new apex.server.process approach:
function resynchronizeProductProfile(productProfileID)
{
var resynchronizeResult;
$s( 'PRS_PRODUCT_PROFILE_ID', productProfileID );
$s( 'PRS_PROFILE_OPERATION', 'EDIT_PROFILE' );
apex.server.process( 'MAINTAIN_PRODUCT_PROFILE_2'
, { pageItems: "#PRS_PRODUCT_PROFILE_ID,#PRS_PROFILE_OPERATION" }
, { dataType: "text",
async: false,
complete: function( ajaxResponse )
{
var resynchronizeResult = ajaxResponse.responseText;
}
});
return resynchronizeResult;
}
However, in the new version, the arguments do not appear to be getting set when the MAINTAIN_PRODUCT_PROFILE_2 application process is invoked. PRS_PROFILE_OPERATION, for example, is set to '' although, above, you can see that it is, in fact, hard coded to 'EDIT_PROFILE'
Typically, the call to apex.server.process sets item values both in the page and in the session in one step. This doesn't appear to be happening with Application Items (although it works just fine for Page Items).
What's up with this? Anyone see my error?
Thanks,
-Joe
Message was edited by: Joe Upshaw