Run Script in workflow is not working.

Sunny45
Kilo Guru

Hello,

I have following Run script in Workflow which doesn't execute properly.  I have confirmed that the scratchpad variable is assigned to sysid2 variable properly, but GlideRecord query fails and doesn't update the record. 

Now the same code works just fine on script background. Not sure what is going on. Where can I look for possible issues?

Please advise.

Thanks.

find_real_file.png

 

find_real_file.png

 

find_real_file.png

 

1 ACCEPTED SOLUTION

Narsing1
Mega Sage

Can you try with this.

 

workflow.info("Scratchpad Value is = " + workflow.scratchpad.sysId.toString());

var sysid2 = workflow.scratchpad.sysId.toString();

Observe these logs in Workflow ==> Executing Activities whether it is able to display the above log.

Example

find_real_file.png

Please mark it as correct answer if it helps.

Thanks,

Narsing

View solution in original post

8 REPLIES 8

MrMuhammad
Giga Sage

Hi, Can you try placing a log few logs in the run script specially on sysid2 and inside if statement. Please share what you get in the logs. 

Also, try passing a static sys_id in the run script as well, and if that works. That will ensure whether the issue is with the scratchpad variable or anywhere else.

Regards,
Muhammad

Thanks Muhammad for your time. 

Narsing1
Mega Sage

Can you try with this.

 

workflow.info("Scratchpad Value is = " + workflow.scratchpad.sysId.toString());

var sysid2 = workflow.scratchpad.sysId.toString();

Observe these logs in Workflow ==> Executing Activities whether it is able to display the above log.

Example

find_real_file.png

Please mark it as correct answer if it helps.

Thanks,

Narsing

Thanks Narsing. That did the trick. 

Wonder why, it was working fine all these time and all of a sudden had a need to change scratchpad variable to String. 

Is it something changed during version? This WF was working fine since Istanbul version and now we are on Newyork.