Cancel UI button issue on SIR (Security Incident Response) Module

Seraj
Tera Guru

Hi All,
I am facing one issue with UI Action where i want to customize default cancel ui action button which validate work notes before cancelling.
Problem : When i am trying to execute client side and server side script at the same time on my company dev instance then it is not working but again if i am trying same code on personal developer instance it is working fine.
So i tried to change the action name on my company dev instance then it working fine.
Here is script

function onClick() {

    g_form.setMandatory('work_notes', true);

    gsftSubmit(null, g_form.getFormElement(), 'cancel');

}

if (typeof window == 'undefined') {

    setCurrent();

}

function setCurrent() {

    var wf = new global.Workflow();

    wf.cancel(current);

    current.state = 7;

    current.update();

    action.setRedirectURL(current)

}

Please help me on this issue
Thanks

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Seraj 

if in your customer instance same action name is present then it may conflict

So it's recommended to have unique action name for each UI action in the instance.

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

@Seraj 

Thank you for marking my response as helpful.

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