Wednesday, August 28, 2019

Multiple approvers for Approval process in Salesforce Classic


1. Go to Setup >> Create>> Workflow and Approvals >> Approval Processes.



2. Select the object to create approval process.

3. Click "Create New Approval Process" button and click "Use Standard Setup Wizard" link.




4. Enter a name and description for your new approval process.

5. Click "Next" button.





6.  Specify Entry Criteria.

7. Click "Next" button.





8.  Specify Approver Field and Record Editability Properties.

9. Click "Next" button.




10. Select Notification Templates.

11. Click "Next" button.



12. Select Fields to Display on Approval Page Layout.

13. Click "Next" button.




14. Specify Initial Submitters.

15. Click "Save" button. 



16. Select "No, I'll do this later, take me to the approval process detail page to review what I've just created".

17. Click "Go" button.



 18. Click "New Approval Step' button.




19. Enter Name and Description.

20. Click "Next" button.




21. Specify Step Criteria.

22. Click "Next" button.



23. Select "Automatically assign to approver(s)".

24. Select the "Queue" or "User" or "Related User".

25. When multiple approvers are selected, select anyone of the following

    a. Approve or reject based on the FIRST response.
    b. Require UNANIMOUS approval from all selected approvers.

26. Click "Add Row" link to add multiple approvers. 

27. Click "Save" button.



28. Click "Activate" button to activate your approval process.





29. Go to the Object's page layout and add Submit for Approval button and Approval History related list.





30. Add "Submit for Approval" button.





31. Add "Approval History" related list.




Output:











Monday, August 26, 2019

Apex REST Code Sample Using RestRequest - Simple as Pie

I always wonder why people are not creating or interacting with Salesforce more using webservices.

If you are..then well done.

The world of possibilities and the layers of integration become infinite.

Always familiarize yourself with utilizing services and definitely create yourself a sandbox.




Apex REST Basic Code Sample

reference : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_code_sample_basic.htm

@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {

    @HttpDelete
    global static void doDelete() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Account account = [SELECT Id FROM Account WHERE Id = :accountId];
        delete account;
    }
  
    @HttpGet
    global static Account doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
        return result;
    }
  
  @HttpPost
    global static String doPost(String name,
        String phone, String website) {
        Account account = new Account();
        account.Name = name;
        account.phone = phone;
        account.website = website;
        insert account;
        return account.Id;
    }
}



example : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_code_sample_restrequest.htm

@RestResource(urlMapping='/MyRestContextExample/*')
global with sharing class MyRestContextExample {

    @HttpGet
    global static Account doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
        return result;
    }
  
}


As with the formula post this will be the start of a series where I will post more real life examples.

Stay tuned :-)



Monday, August 12, 2019

owner or user is inactive, orgId: 00DA0000000XXxx


So I ran into this nasty little bugger and my approval process came to a grinding halt.

For those who have never seen this before your first inclination is to research the error but this does not necessarily equal your solution.


Many refer you to batch jobs, Salesforce connections and more ...the bottom line is simple though....

What were you doing when you got this error?

For me, it was part of my approval process, so my next step was to investigate the process.

Salesforce>>Set Up>>Process Automation >> Approval Processes

 I had a user which was no longer active but was still part of the process.

Solution : Remove the user and my process was back on track


Sidebar : Never forget that it is important to look at ...


  • What was I doing that created the error?
  • Can I recreate it?
  • What does the error say?

If this doesn't assist in resolving your issue feel free to reach out to me and we find a solution together.

Yours in Tech 
Jerome Slinger 
“I cannot teach anybody anything. I can only make them think.”― Socrates

Generate reports from Opportunities using a Visualforce Page in Salesforce

  Step 1: Create a Visualforce Page Go to the Setup menu in Salesforce. Search for "Visualforce Pages" in the Quick Find box and c...