Showing posts with label OnDemandProcess. Show all posts
Showing posts with label OnDemandProcess. Show all posts

Friday, February 1, 2013

APP_PAGE_ID=0 in OnDemandProcess

In APEX we have many Substitution Strings. One of these is :APP_PAGE_ID. Be careful with this String in an OnDemandProcess. I have called an OnDemandProcess by using JavaScript/AJAX and the result was, that :APP_PAGE_ID was always 0.
To solve this problem i have created an Application Item (AI_APP_PAGE_ID). This item will be filled every time a page is rendered in APEX.

*Update*
Due some good tips the problem can be solved by calling the OnDemandProcess with the correct full syntax from JavaScript.
var ajaxCall = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=IS_HANDLE_VALID', $v('pFlowStepId'));
With this call especially the last parameter $v('pFlowStepId') the pageId will be the actual ApexPageId where the Javascript is used.
Thanks to Peter and Roel for your tips.