Hi,
This is my first post so go easy on me!
I'm having trouble opening a modal page via JavaScript. So I have an Interactive Report with an edit link URL set to "javascript: openCalibrateDialog('#UOM#');". The dialog window fires but the contents reads:
Application 401 Dialog page 1026 cannot be rendered successfully. Ensure the page template in use on page 1026 is of template type "Dialog page", with appropriate JavaScript dialog initialization, dialog closure and dialog cancel code defined
I can confirm that page 1026 is a dialog page and that I can get it to open elsewhere successfully via a standard link target.
Here's my JS:
function openCalibrateDialog(uom) {
var url = getCalibrateUrl(uom);
var options = {title:'Equipment Calibration',height:'500',width:'720',maxWidth:'960',modal:true,dialog:null};
var classes = 't-Dialog--standard';
var $triggeringElement = $('#uom-report');
apex.navigation.dialog(url, options, classes, $triggeringElement);
}
function getCalibrateUrl(uom) {
var url = 'f?p=#APP#:1026:#SESSION#::NO:RP,1026:P1026_AEE_ID,P1026_UOM,P1026_START_DATE,P1026_END_DATE:#AEE_ID#,#UOM#,#DATE_START#,#DATE_END#';
url = url.replace('#APP#', $v('pFlowId'));
url = url.replace('#SESSION#', $v('pInstance'));
url = url.replace('#AEE_ID#', $v('P1008_AEE_ID'));
url = url.replace('#UOM#', uom);
url = url.replace('#DATE_START#', $v('P1008_DATE_START'));
url = url.replace('#DATE_END#', $v('P1008_DATE_END'));
return url;
}
Going by the JS API for apex.navigation.dialog it looks like it should work. The only thing that sticks out to me is that I don't have a checksum (p_dialog_cs) value in my URL which is usually generated automatically by Apex.
Any help is much appreciated.
Thanks,
Tom
p.s. just to pre-empt the question "Why aren't you using a standard link target?" - I need the current values of the page items being passed through the URL (obviously these could have changed since page load).