Wednesday, 28 February 2024

How to Call Modal Dialog in Apex Using Java script and Pass the Parameters

 How to Call Modal Dialog in Apex Using Java script and Pass the Parameters


Create a Dynamic Action and Use the Code on Double Click Event


var x = apex.item('P492_COSTNO').getValue();
var url = "f?p=#APP_ID#:493:#SESSION#::NO:RP,493:P493_COSTNO:#P492_COSTNO#";
url = url.replace("#APP_ID#", $v("pFlowId"));
url = url.replace("#SESSION#", $v("pInstance"));
url = url.replace("#P492_COSTNO#", x);
apex.server.process("PREPARE_URL", {
x01: url
  }, {
  success: function(pData) {
   if (pData.success === true) {
     apex.navigation.redirect(pData.url);
   } else {
     console.log("FALSE");
   }
 },
error: function(request, status, error) {
console.log("status---" + status + " error----" + error);
  }
});


Then Create a Process on Ajaxcallback and Name it PREPARE_URL

THEN Add the Folowing Code

declare
result varchar2(23333);
begin
result:=apex_util.prepare_url(apex_application.g_x01);
apex_json.open_object;
apex_json.write('success', true);
apex_json.write('url', result);
apex_json.close_object;
exception
when others then
apex_json.open_object;
apex_json.write('success', false);
apex_json.write('message', sqlerrm);
apex_json.close_object;
end;

No comments:

Post a Comment

Check Internet Connectivity on Local System

if (!navigator.onLine) {     showOfflineAlert(); } else {     // Set a strict 3-second network timeout threshold     const controller = new ...