- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 09:16 AM
Now the demand is if someone choose the RITM in request line field that the Ritm field value Location and Assigned too should be auto populated AND RITM variable value named 'Cost Center' which is reference variable..should also be populate of that RITM in Consumable field record.
Below is the script , its works for location but not for cost center
var GetRITMDetails = Class.create();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 01:03 PM
i am using this now and its working but now i want to make the requested for of ritm equals to assigned to of consumable and its fetching the sys id but its not seeting the field value. can you help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 09:51 AM
Hi @AbdulrehmanT,
Dereferencing the variable correctly:
You're accessing mtom.sc_item_option.value, but when the variable is a reference, you need to get the actual sys_id of the referenced record, not just the display value.
The sc_item_option is a reference field on sc_item_option_mtom. You must use .getRefRecord() to properly access the variable's value.
Ensure the variable name comparison is case-sensitive:
Double-check if the variable name in your condition ('cost_center') matches the exact name (not label) defined in the variable configuration.
Modify your loop to use:
var itemOption = mtom.sc_item_option.getRefRecord();
if (!itemOption)
continue;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 01:03 PM
i am using this now and its working but now i want to make the requested for of ritm equals to assigned to of consumable and its fetching the sys id but its not seeting the field value. can you help
