Check for a condition in the script of an UI Action

mitzaka
Mega Guru

Hi SNC,

 

I have an UI Action button which basically needs just to set some fields to certain values.

What I need though is a way to check if a field is empty and if so, populate it with the current logged on user.

 

Should I be looking for something like this or there is a simpler way?

http://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Let me think .. First, why do we need a client + server side button for this ?


Can't we just use this and have a simple UI action without client action involved ?



if(current.field == '')


{


current.userField = gs.getUserID();


}



Makes sense????


View solution in original post

5 REPLIES 5

Sounded like the easiest approach, but totally worked. Thanks!