Issues with Overriding of requested for on REQ and RITM with a particular logged in user.

Sonu Singh
Mega Expert

Hi All,

When User1 submits the catalog Request with Requested For as REQUser1,  then in REQ and RITM form Requested For is getting changed to User1

But if i impersonate user to any other user say USER2, then its working fine. whatever was mentioned requested for on the catalog form its getting populated same in REQ and RITM form.

This is occurring for a particular user. Can anyone please help to understand why it is happening.

 

Regards,

Ak

 

 

1 ACCEPTED SOLUTION

Do note that post was only about sc_request. So you also need to add a query for your sc_cart.
An extract from that post:

---

Business Rule
Table: sc_req_item
Insert = true
When: Async

Condition:

current.request.requested_for != current.variables.requested_for

Script:

(function executeRule(current, previous /*null when async*/) {

	var grREQ = new GlideRecord('sc_request');
	grREQ.get(current.getValue('request'));

	grREQ.setValue('requested_for', current.variables.requested_for);
	grREQ.update();
		
})(current, previous);

Works instantly.

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

10 REPLIES 10

@Mark Roethof 

 

There is one more requirement,  

I have a variable, Administration (List Collector type: refer: sys_user) ,through Flow Designer i am trying to update those value to cmdb_rel_person table.

 

Requirement is Administration can have multiple users for a CI.

 

Flow designer:

fig1:

find_real_file.png

 

fig2.:

find_real_file.png

 

Thanks

Ak