GlideModal call back function not working - error - Uncaught ReferenceError: <<name of callback function>> is not defined

Sourabh Purani1
Kilo Explorer

I am trying to replicate the functionality of Cancel Change request on one of my custom form.

I created exactly same UI Action (Cancel Change) and UI Page (change_confirm_cancel) as that of OOTB change cancel functionality.

However, I am able to get dialog window to enter the comments but when I click on OK button on the dialog box, it does nothing (dialog doesn't get closed) and I can see error in browser debug window:

VM7492:4 Uncaught ReferenceError: moveToCancel is not defined
at HTMLButtonElement.cancelChangeRequest (eval at evalScript (js_includes_doctype.jsx?v=03-02-2020_2243&lp=Tue_Mar_03_02_34_58_PST_2020&c=5_59:84), <anonymous>:4:3)
cancelChangeRequest @ VM7492:4

 

Interestingly, same OOTB functionality, with same code works fine in Change management.

Any help appreciated.

8 REPLIES 8

The SN Nerd
Giga Sage
Giga Sage

Is the function moveToCancel() defined in your UI action?

It may be a UI Script loaded in the Change form but not in your form / table.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

In fact, I was created function on different name suitable to my requirement to capture rejection reason. However that was not working. Hence I copied as it is script from OOTB objects, but still that didn't work.

Same working fine on change form.

Sourabh Purani1
Kilo Explorer

find_real_file.png

Ricardo Trejo
Kilo Explorer

Hello friend, I have the same problem, how did you solve it? Thanks and regards.