Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page not running processing script

grosch
Mega Expert

In my UI Page I've stuck this line to create the ok and cancel buttons:

<g:dialog_buttons_ok_cancel ok="return makeChanges()" ok_type="button" cancel_type="button" />

I then have this in the client script window:

function makeChanges() {

      var service = gel("service").value;

      if (!service) {

              alert("Please select a service to update.");

              return false;

      }

      GlideDialogWindow.get().destroy(); //Close the dialog window

      return true;

}

When I hit OK, the window just goes away.   The code that I have in the Processing script never runs.   Is it because I listed an "ok" callback?   Basically I need to make sure the input is OK and then if it is do the work server side.

16 REPLIES 16

Hi Adam,


                      You find any fix for this ? I am having the same issue. Let me know if you found any fix for this.



Thanks,


Sai.


Rodrigo Higa
Kilo Guru

Hi Scott,



The properties tag "ok_type="button" cancel_type="button" are overriding the standard button's behaviour. Removing them the processing script will run.



I wont need the GlideDialogWindow.get().destroy();, neither.



Regards