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 Action, is it possible that gsftSubmit() returns value?

PhoenixMing0912
Giga Expert

For example

function on_test(){

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

}

 

I want to do some client scripts after calling gsftSubmit() and use some values from server.

I have also tried GlideAjax, however, in my server side scripti I need to use current.update() which is not supported in AJAX script include.

 

1 ACCEPTED SOLUTION

Hi Phoenix,

I haven't come across scenario where you will write code after gsftSubmit()

that line is used to pass control from client to server only client side script or validations are done

you can have async GlideAjax just before gsftSubmit() is you want to update the record and that script include function will update the record

Regards
Ankur

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

View solution in original post

12 REPLIES 12

Thanks for the reply. These threads focus on using gsftSubmit to make the UI Action work on server side. It's not really the question I asked.

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Phoenix,

Can you provide some additional details on what you are trying to accomplish? You can execute client side code in the UI action (client checkbox to true) and make a call to GlideAjax to execute the server side code.

 

- Pradeep Sharma

Yes, GildeAjax is an alternative way, but how to pass the current record to GlideAjax?

Just like gsftSubmit(null, g_form.getFormElement(), 'test');