- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 03:11 PM
I have a custom table, that has a reference field to a RITM number in it.
I also have a requested_by reference field in that table.
When someone changes the RITM number in my custom table, I would like it to update the requested_by field in my custom table to match the requested_by value for that RITM in the sc_req_item.
This seems like it should be simple, but I cannot get it to work...
Ideas?
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 05:51 AM
I could not get to it this way, my business rule was good, but I was looking for the wrong value. I was thinking we had requested_by instead of requested for..
Simple enough in end, once I had the right field...
(function executeRule(current, previous /*null when async*/) {
// gs.addInfoMessage(current.u_ritm);
var getReqby = new GlideRecord('sc_req_item');
getReqby.addQuery('sys_id', current.u_ritm);
getReqby.query();
if(getReqby.next()){
current.u_requested_by = getReqby.request.requested_for;
current.u_uses_netid_s =getReqby.variables.netid_passwords;
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 03:15 PM
You need an update onBefore business rule for this with
Condition
RITM Number Changes
Action->
Set Value
Requested By 'Same as' Requested Item.Request.Requested For
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 05:51 AM
I could not get to it this way, my business rule was good, but I was looking for the wrong value. I was thinking we had requested_by instead of requested for..
Simple enough in end, once I had the right field...
(function executeRule(current, previous /*null when async*/) {
// gs.addInfoMessage(current.u_ritm);
var getReqby = new GlideRecord('sc_req_item');
getReqby.addQuery('sys_id', current.u_ritm);
getReqby.query();
if(getReqby.next()){
current.u_requested_by = getReqby.request.requested_for;
current.u_uses_netid_s =getReqby.variables.netid_passwords;
}
})(current, previous);