Hi Vinesh ,
i have created custom authorization scheme
Type ; Pl/Sql Function Return Boolean and it works fine with me
But Now when user Not authorized to open a page this un friendly message appear ,
how to redirect to friendly page in application after authorization fail ?
thanks , in advance
Hi Soliman,
The end-user will not get the whole message; he will get only the below part:
Because you logged in as a developer, so you are getting the whole message, which not looks good.
But still, if you want to redirect to another page, you can use the same PL/SQL function (you used for the authorization scheme) on page load to set a page item value. Then on the change event of that page item, you can redirect to another page using JavaScript.
For example, create a dynamic action on page load to execute PL/SQL code. Now in that code, check with that same function, and if it returns False, then set a hidden page item value to 0. If returns True, then set the hidden page item value to 1.
Now create a dynamic action on hidden page item on change event to execute JavaScript. Specify client-side condition item = value. Set value to 0.
Create a True action to execute JavaScript code and add the following code to redirect to another page:
The above JavaScript code will redirect to the home page after giving the error dialog message.
Dear Vanish ,
sorry to inform you that solution not working for me .
i have created DA in page load , execute PL/SQl Code to Set value in a hidden item
then create DA on hidden item with client side condition and in true action execute javascript code to rediret to another page , But not working
Remove the authorization scheme from the Security section of the page.
Because now you are authorizing on page load manually.
And following is the example of page load dynamic action to Set Value using SQL query:
In the above case, the 0 will return; else, the null value will be set for the hidden item. Now instead of 1 != 2, use your function here. For example:
Please let me know if any questions.
Hi Vinish ,
Thanks , it’s now working fine
but is it recommended to use DA in page Load ?
Please Explain this as i attended a webinar before time and presenter told that it’s not recommended to use DA or Ajax callback in Page load .
is this rule or recommendation is general or in a specific cases we may use ?
Hi Soliman,
If you will ask me for the security point of view, then I would suggest using the authentication scheme for your case.
But for any other reason, there is no issue to use on page load dynamic action to perform certain tasks.