How to save record before trigger an action in one UI Action ?

lampek
Kilo Contributor

Hello Guys

I have an ui action which is triggering event: gs.eventQueue("mim.sms", current, false, value);

But this ui action is as Form Button "Send SMS" which is appearing on the incident page.

There story behind this is: I have a field in Incident form called SMS Body where user can type in string message and after this he click "Send SMS" button without saving the record. But in email notification body which is triggered after clicking the "Send SMS" button In retrieving the field by ${u_test_sms}.

The issue is that this is ${u_test_sms} empty. This is only working when user first the value for SMS Body and then save record and then click "Send SMS".

My question is if there is a possibility in the same ui action first save record and then trigger event ?

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Michal,



Can you add the line current.update(); and then have the gs. eventqueue line of code.


Client & Server Code in One UI Action - ServiceNow Guru


View solution in original post

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Michal,



Can you add the line current.update(); and then have the gs. eventqueue line of code.


Client & Server Code in One UI Action - ServiceNow Guru


Works perfect, thanks!


manikorada
ServiceNow Employee
ServiceNow Employee

Michal,



In the UI action first have the current.update() and then use the gs.eventQueue() method something like:



current.update();


gs.eventQueue("mim.sms", current, false, value);