- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2019 10:19 AM
I am trying to create a Catalog Item with (among other things) the following two fields: Submitter and Approver.
I want to put a filter on the Approver field, so it is dependent upon the Submitter. Basically, the choices for Approver should be limited to:
- Submitter's Manager
- Submitter's Manager's Manager
I don't foresee having to go much further than that (although I would not be opposed to adding one level higher; the Submitter's Manager's Manager's Manager).
I am not sure what that filter would look like. Can someone help?
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2019 03:08 AM
Here is the screenshot, use this as reference.
Script Include:
Variable where filtered result is required, for your case it is approver
Here is the output:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2019 01:08 PM
Hmmm... still not working.
Here is my Script Include code:
function escalatingManagers(submitter){
var query = '';
query = 'sys_idIN'+submitter.manager.sys_id+','+submitter.manager.manager.sys_id+','+submitter.manager.manager.manager.sys_id;
return query;
}
and here is how I am calling it in my Referece qual:
javascript: escalatingManagers(current.variables.submitter)
It still shows the managers from the default value of my submitter variable.
What am I doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2019 03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2019 05:38 AM
It still has the same problem as my version of the code did. It does the initial population fine, but if you change the submitter, it doesn't change the options under the approver. Did you try doing that?
Note that I have a default value on my Submitter field, like this:
So, initially, submitter loads with a default of the logged in user. So the approver box initially shows the managers for that logged on user. However, if you elect to change the submitter to someone else, the approver options are not being updated. It is still showing the managers for the logged on user and not the current person in the submitter field.
So i need to figure out how to make the managers listed in the approvers drop-down options to change as the submitter is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 06:17 PM
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2019 06:57 AM
So, I was having no luck last week. Tried again this morning, and it works! I don't know why that is. The only thing I can think of is my internet cache was not cleared, and kept applying the initial way.
In any evemt, all is good now.
Thank you for your help!