RITM | OnChange client script from Requested for OOB field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 04:32 AM
Hi there,
I have this requirement to change the location from a requested item when the requested for changes and I have created a on change client script with the requested for field as a trigger, however it doesn't work, don't even run.
And I noticed that the OOB field is a dot-walking field, so probably this is the cause of that isn't working.
Do you any idea how I can achieve this? With changing the field
Thanks in advance.
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 02:48 AM
The only possible solution is to set the location on server level by writing a business rule on request table and the trigger should be "Requested For changes". Write a script which will fetch the RITM record and update the location.
Sample Code :
var RITM = new GlideRecord('sc_req_item');
RITM.addQuery('request',current.sys_id);
RITM.query();
while(RITM.next())
{
RITM.location = ""; //your location logic
RITM.update();
}