+ Start a Discussion
Emilien GuichardEmilien Guichard 

Use queues for approval process with opportunities

Hi there,

I have a requirement to use queues for approval process with opportunities so that an opportunity approval could be given by any user in the queue.
As there is no queues for this object, it's impossible to use the standard.

I looking for a way to fullfil this requirement using visualforce and apex development.

Thanks for your help.
You can't create a queue for opportunity object, however you can assign group of users to queue and then you can route your approval request to that particular queue.
Emilien GuichardEmilien Guichard
Sadly it's not possible, queues must be related to an object and when I create an approval for the opportunity object I don't have the possibility to choose a queue to route the approval requests.
Why can't you use Public groups instead of Queue to route the approval requests ??
Emilien GuichardEmilien Guichard
Is that even possible ? When I select approvers on the opportunity approval process, I can only select user or associated user.
I was talking about submitting approval request using Apex,something likw below :-

public void submitForApproval(Opportunity opp)
        // Create an approval request for the Opportunity
        Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting request for approval automatically using Trigger');
        req1.setNextApproverIds(new List<Id>{'005i0000000h5az', '005i0000000hASk'}); // here you can declare list of users whom you want to give approver rights

        // Submit the approval request for the Opportunity
        Approval.ProcessResult result = Approval.process(req1);


Hope this helps !!