Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Does the submit for approval process works in Salesforce1? Is there currently a way to submit custom objects for approval in the Salesforce1 mobile app?


Yes, thanks! I also wrote a trigger to toggle the approval process from the post (publisher action menue)

trigger Feed_Item on FeedItem (after delete, after insert, after undelete, after update, before delete, before insert, before update) {

if(trigger.isBefore && Trigger.isInsert) {
      for (FeedItem f : trigger.new)
      {
         if (f.Body.startsWith('!')) {
           approval.ProcessSubmitRequest aprlPrcs = new   Approval.ProcessSubmitRequest();      
           aprlPrcs .setComments('Submitting record for approval.');
           aprlPrcs.setObjectId(f.parentId);
           approval.ProcessResult result = Approval.process(aprlPrcs);

           f.Body='Submitting record for approval';
         }            
      }
}

}

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

http://help.salesforce.com/apex/HTViewSolution?id=000187389&language=en_US

As per the above document

These approval-related options aren’t available in the Salesforce1 app:

• Submitting records for approval.

• Recalling approval requests.

• Reassigning approval requests.

• Accessing an approval request from the record view. Instead, approvers need to tap the Salesforce1 notification.

• Manually selecting the next approver. For approval requests that require this manual selection, the approver needs to log in to the full Salesforce site.

So an alternate approach can be to use Publisher Actions and use approval processing classes and build the visualforce page with action attribute defining logic and using Publisher action.

Sample approval process class would be as follows

// Create an approval request for the account
    Approval.ProcessSubmitRequest req1 = 
        new Approval.ProcessSubmitRequest();
    req1.setComments('Submitting request for approval.');
    req1.setObjectId(a.id);

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

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_example.htm

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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