Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get the sys id of the target table in the producer script in RP

shaik_irfan
Tera Guru

Hi,

 

On the record producer script i have a script written to insert a new record in custom table which is working fine. Now the record producer is creted on incident table i want to relate the record which i am creating via script is for associate incident, so how can i get the sys id or the incident number for the target record in the producer script ?

1 ACCEPTED SOLUTION

Hi Irfan,

 

Can you add something as below before your gr_rec.insert();

gr_rec.(yourreferencefieldname)=current.sys_id;

 

I did try it in my PDI & it works as sys_id for the record is generated before other updates so the above works.

View solution in original post

10 REPLIES 10

Thank you Sir, but the above Mark and Jaspal did worked for me