Why cancel button for problem is not working for workspace?

Prathamesh Chav
Tera Contributor

Hi Team,

 

Cancel button is not working for Problem.

PrathameshChav_0-1737538751047.png

 

 

Script :-

 

function onCancel() {
    if (g_form && g_form.mandatoryCheck()) {
        ScriptLoader.getScripts("ProblemModalUIHelpers.jsdbx", function() {
            ProblemModalUIHelpers.problem_Cancel();
            action.setRedirectURL(current);
            action.setActionName('cancel');
        });
    }
}
 

PrathameshChav_1-1737538775188.png

PrathameshChav_2-1737538799058.png

 

This is the OOTB button,

same button is working in m py PDI also after clicking cancel button state changes to root cause analysis, but after that again clicking on cancel its not working?

what could be  the issue, only workspace script I can see few lines added, I dont think those lines are reason of issue, also tried to remove them

9 REPLIES 9

@Prathamesh Chav 

something like this in workspace client script, ensure both the checkboxes are checked 

function onClick(g_form) {
    if (g_form.getValue('close_notes') == '') {
        g_form.addInfoMessage(getMessage('Please fill the value'));
		g_form.setMandatory('close_notes', true);
        return;
    }

}

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

NagaChandaE
Kilo Sage

PrathameshChav_2-1737538799058.png

make true the check box format for configurational workspace.

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

Regards
Naga Chandan

Hi @NagaChandaE @Ankur Bawiskar  ,

 

What is use of format for configurational workspace, I checked but its not working and its also not going back to unchecked?

 

How to do that?

 

By checking only the script will run otherwise it just show you a button. 

Actually the cancel button in sow workspace is not a ui action. It is a declarative action specifically designed for workspaces.

You just uncheck the workspace form buttton and format for workspace and remove code it will work normally . update me whether it worked or not