Yes. I just didnt have it in the version I posted. Updated it. It has the grhasci.update

Can you share that exact code? Maybe there's just a typo.

Also try to add debugging (or if Orlando, use logpoints). With debugging, you could easily see where your script is still working, and from which points it fails/doesn't reach, if the variables contain the values you would expect, etc.. This helps to pinpoint much quicker

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

A I see you updated the code.

At least this will not work:

grhasci.setValue('model_id.sys_id=', target_modelsysid);

Try:

grhasci.setValue('model_id', target_modelsysid);

Do debug if the below while actually is reached. And if it concerns a large number or records, look at what I wrote about updateMultiple.

while (grhasci.next()){

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

I think this is working now: grhasci.setValue('model_id', target_modelsysid);

Glad that it's working now.

 

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn