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

Ankur Bawiskar
Tera Patron
Tera Patron

@Prathamesh Chav 

did you add the workspace client script lines from your side?

If yes then action object won't work in client side.

what's the button doing? Is it changing the state to cancel and reloading?

If yes then something similar can be done in workspace client script as well

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

Hi @Ankur Bawiskar ,

 

Line are added for making close notes mandatory.

I am trying to change the state close here

@Prathamesh Chav 

so you want to make close notes mandatory in workspace client script?

If yes then simply check value and if empty then make mandatory and use return statement

you can find lot of OOB UI actions with similar workspace client script

Did you check that?

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

Hi @Ankur Bawiskar ,

Can you tell me syntax for return statement