Script Action is not working

Chandresh
Tera Guru

I have invoked an event by business rule and that event is triggering fine. I have checked that in the event log.

The main issue is I have created one script action corresponding to that event but that script action is not working. All I am doing in that script action is creating records.Please check attached snapshot.

Is there any issue with the script action script.?

event.PNG

13 REPLIES 13

Chandresh
Tera Guru

Also, I checked the script logs as well. On checking the logs I did some random search and found below KB article related to below logs.


ServiceNow KB: PRB565663: Event generates error to EventRecord: getEventTarget() called with invalid...  


Does anybody have any idea about this??


logs.PNG


xiaix
Tera Guru

I'm assuming that the commented out code is what's not working?



If so, it's choking on "shifts" because "shifts" isn't defined.



For example,



us1.u_shift_management_number = shifts.u_number;




The code says, where/what is 'shifts' ?


Hi David/ Rahul,



Thanks for your response. I believe if the code is commented out then it will not check that code. It will simply skip the commented out part. However, I removed the commented out part from the Script Action code and still it is not working. I am getting the same output as above. Below is the snapshot.



find_real_file.png


Rahul Jain11
Kilo Guru

Agreed with David.



shifts object is not defined in your script.