Why Requested For is auto populating incorrectly in Request summary and RITM record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:24 AM
Hi Community,
I created a request for Aaron Shelly from portal and submitted the form.
After Submitting the form,in Request Summary showing Requested For as incorrect user name.
In platform,for REQ Requested For is showing correct.
but for RITM,its showing incorrect user name.
Could anybody please help with this issue?
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:31 AM
Hi,
Did you check, how the requested for field is getting populated? (check the workflow and business rules)
Also, why Request field is showing as the user instead of the request number,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 04:25 AM
Hi Balaji,
In workflow,we have run script to set the requested for value.However when user navigate to item that value is auto populating but when user changes requested for value and submits the form.Why still it's showing requestor name instead of Requested by name.
Also I checked no business rule is there.
Thanks,
Ankita Kolhe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:33 AM
Check the field mapping of variable to the requested item table field in BR/workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:37 AM
Hi,
requested_for field on REQ gets defaulted to logged in user.
If you are submitting then it would show your name
If you wish to update the requested_for field of REQ with variable value then you need to use after insert BR on RITM table
BR: After Insert on sc_req_item
Condition: // give the item name here
current.cat_item.name == 'Order an iPhone'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var req = current.request.getRefRecord();
req.requested_for = current.variables.requested_for; // give variable name here
req.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader