0

I have a custom app with a custom object. I want to have an approval process on the object. Ideally I want to have a lookup field to the user records on the custom object that allows me to select a user as the approver.

However when I look at the approval process I can only select the MANAGER or a custom hierarchy field on the USER record as the approver, I can't seem to select a custom field from the custom object.

Since the creators of these records will not have access to edit user records I would need to get an admin to update them every time one is create to make that work which is crazy.

Any ideas or suggestions appreciated!

  • will the option "Let the Submitter choose the approver manually" won't work for you? – sfdcFanBoy May 26 '16 at 5:06
  • Unfortunately I want the approval cycle fixed by the data and not expect the user to select the approver each time, thanks for the idea. – chriscwharris May 27 '16 at 10:11
1

I believe what you need to do is as follows:

  1. Create lookup field to User on custom object Foo__c. I named mine User (approver) but name can be anything.
  2. When creating the approval process (shown here from Jump Start wizard), choose the last radio button and then Related User in dropdown. The rightmost drop down is a list of lookup fields to User on your Foo__c

enter image description here

  • The only problem I can see is that I need the related user lookup on the record needing approval? I actually want to set the approver name on the parent object to the record that needs approval. Is there a way to set the user on the child or lookup the approver from the parent when the child is saved? – chriscwharris May 27 '16 at 10:58
  • @chriscwharris - just to be clear, the submit for approval button is clicked on the child record but you need a custom user field on the child's parent to be used as the approver? – cropredy May 27 '16 at 15:17
  • Yes, the approver is set on the parent using a Lookup to a User record. When I create child records I want the approval to use that User as the approver. I don't want the submitter to have to manually select the approver each time time they submit for approval. – chriscwharris Jun 6 '16 at 15:47
  • Because the target object for the approval is the child record, you will need a custom field on child of type email which is synchronized from the parent's lookup field to User. Such synchronization can be done by triggers or process builder (not workflow) – cropredy Jun 6 '16 at 15:51
  • So when I create the child, a trigger or process runs that gets the approver name from the parent, then uses that to get the user record for the approver and from there I can get the email address. That will allow me to do the notification from the approval but will it allow me to set the approver so the security works? from what I can see I can only assign automatically to a user, queue or related user. – chriscwharris Jun 6 '16 at 16:01
0

If you need to set the custom lookup user field on the custom record, to allow your end users complete this lookup filed as a future approver, apex approval offers a dynamic choice.

This old post gives an example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.