Monday, June 19, 2017

Notification_Msg and checksum, and undocumented Oracle APEX tricks

I am sharing an Oracle APEX trick that I have just found because of a project requirement. It is not documented and took a while for me to figure it out.

If you want to pass a notification message or success message to a next page by using URL redirect, you just need to concatenate following strings to the end of your URL ( &notification_msg=[your message]/[message checksum]/ )
(If you use branch it simply happens if you click “include process success message”.)

Example PL/SQL code:
v_NOT_FOUND_TICKET_MSG       varchar2(512) := 'App+can+not+get+this+ticket+information+from+XXXX!+This+information+may+not+be+up+to+date.';
v_URL  := v_URL || '&notification_msg=' || v_NOT_FOUND_TICKET_MSG || '/' ||  WWV_FLOW_UTILITIES.LOV_CHECKSUM(v_NOT_FOUND_TICKET_MSG) || '/';

Extra info:
WWV_FLOW_UTILITIES.LOV_CHECKSUM is an internal function that generates an MD5 after removing special characters and adding application Salt. (APEX for some usage create Salt from IP by HEXTORAW(L_SESSION_REC.IP_ADDRESS) and some time from Application Alias). GET_PAGE_CHECKSUM also is quite similar with some additional Salt concatenated like page number and the request.

Example URL: (%2F is equal to / which is a URL encode APEX automatically does):

https://myserver.com/apex/f?p=100:1:11159238055826::::P4_ID:3254&notification_msg=App+can+not+get+this+ticket+information+from+XXXX!+This+information+may+not+be+up+to+date.%2FC7E9A908F8ED9DD46FF05BE88E2C405C%2F

Note: in URL encoding we replace space with +

No comments:

Post a Comment