UI action on form load error

Wade Clairmont
Tera Guru

Hey all,

for some reason, all of a sudden I am getting an error on form load:

actio error.png

Why does ServiceNow run UI actions on form load?   Especially when it is a "close" action.   I just want to view the record, not action it.

Here are the details on the UI action

action error 2.jpg

Any advice?

Thanks in advance.

1 ACCEPTED SOLUTION

Ken83
Mega Guru

I think it's because you have the "Client" box checked and you are using "current" in the script. On the client side, "current" is not a valid reference to an object. You would have to use g_form.getUniqueValue() on the client side which should output the equivalent of current.sys_id.


View solution in original post

3 REPLIES 3

Ken83
Mega Guru

I think it's because you have the "Client" box checked and you are using "current" in the script. On the client side, "current" is not a valid reference to an object. You would have to use g_form.getUniqueValue() on the client side which should output the equivalent of current.sys_id.


Victor Ruiz
Tera Guru

Add your server side query to a new function.


Wade Clairmont
Tera Guru

Ken,  



Thanks!   I removed the Client side indicator and the error was resolved, well done!



Quick question again,   can you read from Watch_list like this?



var watch = g_form.getValue(watch_list);


//Trigger the event to trigger notification and pass all the users


gs.eventQueue("VIT.ehs.submission", current, watch);



Or is there something I am missing.