Error while calling custom UI Page in Major Incident Management

linda_richards
Giga Expert

Hello Community,

 

My requirement is to customize the Major Incident Management UI page that appears after clicking the 'View Workbench' UI action within a major incident record. I am attempting to call my custom UI page by overriding the Out-of-the-Box 'View Workbench' UI action, but I am encountering the following error. 

Your help is much appreciated.

 

linda_richards_0-1751979362439.png

 

Thanks,

Linda

 

1 ACCEPTED SOLUTION

Removing $ sign from below syntax has fixed the issue. $ symbol is reserved for OOTB system UI pages, hence it should not be used for custom UI pages. var url = "/$<ui_page_endpoint>.do?sysparm_stack=no&sysparm_sys_id=" + g_form.getUniqueValue();

 

Thanks,

Linda

View solution in original post

10 REPLIES 10

@linda_richards 

can you share the code of OOTB UI action?

also did you try calling the complete endpoint and not just name for the UI page?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  Here's screenshot of OOTB UI Action and UI Action script content

UI Action Script -

 

function openMIMWorkbench() {
    var url = "/$major_incident_workbench.do?sysparm_stack=no&sysparm_sys_id=" + g_form.getUniqueValue();
   
   
    var isPolarisEnabled = isPolaris();
    if (isPolarisEnabled) {
        var polarisPrefixUrl = "/now/nav/ui/classic/params/target/";
        var query = "/$major_incident_workbench.do?sysparm_stack=no&sysparm_full_theme_support=true&sysparm_use_polaris=true&sysparm_sys_id=" + g_form.getUniqueValue();
        query = encodeURIComponent(query);
        url = polarisPrefixUrl + query;
    }
   
    var gsftFrame = parent.document.getElementById('gsft_main');
    if(!gsftFrame)
            gsftFrame = parent.document.getElementById('testFrame');
    if (gsftFrame) {
        var gsftWindow = gsftFrame.contentWindow || gsftFrame.contentDocument;
        gsftWindow.location = url;
    }
    else {
        parent.location = url;
    }
}

linda_richards_0-1752069996008.png

 

 

 

 

Here's Custom UI action screenshot and UI action script -

 

Script -

 

//gs.addInfoMessage('Success');
function openMIMWorkbench() {
    alert('Success');
    var url = "/$custom_workbench.do?sysparm_stack=no&sysparm_sys_id=" + g_form.getUniqueValue();
   
   
    var isPolarisEnabled = isPolaris();
    if (isPolarisEnabled) {
        var polarisPrefixUrl = "/now/nav/ui/classic/params/target/";
        var query = "/$custom_workbench.do?sysparm_stack=no&sysparm_full_theme_support=true&sysparm_use_polaris=true&sysparm_sys_id=" + g_form.getUniqueValue();
        query = encodeURIComponent(query);
        url = polarisPrefixUrl + query;
    }
   
    var gsftFrame = parent.document.getElementById('gsft_main');
    if(!gsftFrame)
            gsftFrame = parent.document.getElementById('testFrame');
    if (gsftFrame) {
        var gsftWindow = gsftFrame.contentWindow || gsftFrame.contentDocument;
        gsftWindow.location = url;
    }
    else {
        parent.location = url;
    }
}

linda_richards_1-1752070068110.png

 

@linda_richards 

the issue is your UI action is not able to invoke that UI page.

did you try calling the complete name?

AnkurBawiskar_0-1752070600925.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 


I am trying to call the UI page using the complete endpoint URL and the UI page name, but nothing is working.

When examining the OOTB UI action, I see it's calling the UI page as:

var url = "/$major_incident_workbench.do?sysparm_stack=no&sysparm_sys_id=" + g_form.getUniqueValue();
What's confusing is that the OOTB UI page doesn't have any attribute with the value "/$major_incident_workbench". Both the UI page name and endpoint attribute are completely different from what's being referenced. It's unclear where the system is getting the reference to "$major_incident_workbench".

Could you please do me a favor and try to copy the OOTB UI page in your PDI by renaming it, and see if you can call it through View Workbench?