when the manager is requested the item then approval manager should be skip if not need approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I'm not sure I understand you logic. You are looking at a variable and then getting the variables manager and trying to compare it to the opened by. That would always be no because the opened by could be the manager but if you are trying to compare it to who is listed as there manager. Are you trying to make it so that if the open by is the manager of the person it is being submitted for then you can skip the approval? Also are you using a variable for who the items is requested for?
If that is the case a better way to do it would be to dot walk instead of doing a GlideRecords.
answer = ifScript();
function ifScript() {
var reqForMgr = current.variables.requested_for.manager;
var openedBy = current.request.opened_by;
if (reqForMgr == openedBy) {
return 'yes';
}
return 'no';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @brianlan25 ,
Thanks for your help,
but this script:
answer = ifScript();
function ifScript() {
var reqForMgr = current.variables.requested_for.manager;
var openedBy = current.request.opened_by;
if (reqForMgr == openedBy) {
return 'yes';
}
return 'no';
}
skipping for all conditions.
When a catalog item is requested:
If Requested For’s manager = Opened By → skip manager approval
If Requested For’s manager ≠ Opened By → send manager approval
Right now:
Dot-walking skips always
GlideRecord works but logic feels reversed
This is happening
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
They is requested for actually a variable? If not it should be current.request_for.manager. This is working in my instance as this is how we have it setup but we are not using variables for the requested for as we are doing 2 step checkout.
