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.

How to call mobile client script in the Submit button in the mobile app

Elvin_Salim
Tera Contributor

Is there a way to call a mobile client script in the Submit-Save button on the mobile app? 

The idea is that when a specific field on the screen gets an error message and then display a confirmation popup message when the user clicks the Submit-Save button to submit the record.

2 REPLIES 2

Ct111
Tera Sage

Mobile UI actions are stored on the sys_ui_ng_action table, and are accessible on the instance by navigating to System Mobile UI → UI Actions - Mobile

 

Try below script in it and see if it helps

 

 

function onSubmit() {

   g_form.addInfoMessage("Submission successful!");

   // or you could do an alert on the browser
   alert("Submission successful!")
}

 

Hello @Ct111 ,

 

All I can find is that the buttons are on global scope in the ys_ui_ng_action table which is not in the mobile app scope which I am working with. It seems that some buttons are built-in buttons in SN which are not configurable too much. 

 

BR,

Elvin