Filter User Field to Show Manager, Manager's Manager

jmiskey
Kilo Sage

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

1 ACCEPTED SOLUTION

Here is the screenshot, use this as reference.

Script Include:

find_real_file.png

Variable where filtered result is required, for your case it is approver

find_real_file.png

 

Here is the output:

find_real_file.png

View solution in original post

9 REPLIES 9

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?

 

Here is the screenshot, use this as reference.

Script Include:

find_real_file.png

Variable where filtered result is required, for your case it is approver

find_real_file.png

 

Here is the output:

find_real_file.png

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:

find_real_file.png

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.

thanks

jmiskey
Kilo Sage

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!