Converting an UI action to show some popup with warning to be shown after click on 'Cancel'UI action

Deepika54
Tera Contributor

Hello Team,

 

This UI action is not working in workspace. It is only working in Native UI. Do we need to explicitly add any code in the workspace part. When clicked in the workspace, it is not doing anything.

 

@Screenshot 2026-03-31 175212.pngScreenshot 2026-03-31 175244.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Deepika54 

for this workspace client script needs to be updated

add this

function onClick(g_form) {
    var confirmValue = confirm('Are you sure you want to cancel');
    if (confirmValue)
        g_form.submit('cancel');
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

2 REPLIES 2

Deepika54
Tera Contributor

@Ankur Bawiskar Kindly help. this is in response to the previous solution 

Ankur Bawiskar
Tera Patron

@Deepika54 

for this workspace client script needs to be updated

add this

function onClick(g_form) {
    var confirmValue = confirm('Are you sure you want to cancel');
    if (confirmValue)
        g_form.submit('cancel');
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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