Wednesday, 9 August 2017

Salesforce Trailhead : Process Automation Super Badge


Challenge 1:

Validation rule on Lead

Country Validation Rule

Condition Formula: NOT( 
OR(
Country = "US",
Country = "USA",
ISBLANK( Country )
)
)

Error Location: Field Country

State Validation Rule

Condition Formula: OR( 
LEN(State) <> 2,
NOT(CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY:PR", State))
)
Error Location: Field State

Queues:

Queue Name: Rainbow Sales

Queue Name: Assembly System Sales

Assignment Rule:

Rule Name: Trailhead Assigment Rule

Challenge 2:

Account Validation Rules

Billing Country Rule


Shipping Country Rule

Billing State Rule


Shipping State Rule


Account Name Rule

Account Fields:


  • Number of deals (Roll-Up Summary field): Count Opportunity. No filter criteria
  • Number of won deals (Roll-Up Summary field): Count Opportunity with filter criteria as "Stage equals Closed Won"
  • Last won deal date (Roll-Up Summary field): MAX(Opportunity: Close Date) with filter criteria as "Stage equals Closed Won"
  • Deal win % (Formula field): Number_of_won_deals__c / Number_of_deals__c
  • Total amount of won deals (Roll-Up Summary field): SUM(Opportunity: Amount) with filter criteria as "Stage equals Closed Won"
  • Call for Service (Formula field): IF( DATE( YEAR(Last_won_deal_date__c)+2 , MONTH(Last_won_deal_date__c) , DAY(Last_won_deal_date__c) ) <= TODAY(), 'Yes', 'No')

Challenge 3:

Custom Object Creation



Challenge 4:

Add Stage Value:


Add Custom Field:


Add Sales Process:


Add Recordtype

Validation Rule

Challenge 5:

Approval Process:


Note: Make sure you populate manager field on your user record with some valid user. In this case make your manager as Naushi(User you created in your org). If you wont select user manager you wont be able to submit for approval.

Email Alert


Note: Make sure you add a user in email alert

Process Builder:

Opportunity object with option created and updated.

1st and 2nd node end will be changed to evaluate next criteria.



1st Node Criteria

Opportunity Account Type = customer and opportunity.account id not equal to null

1st Node Action

2nd Node Criteria

Opportunity stage = prospecting and opportunity.account id not equal to null and opportunity account type = Prospect.


Note: there will be 2 actions 1 is email same as above and second is creating task. 

2nd Node Action:


3rd Node Action:

Opportunity Stage = Negotiation/Review

3rd Node Action:

4th Node Criteria:

Opportunity Stage = Closed Won

4th Node Action:

2 actions are used in this node.


Challenge 6:

Flow:


  • Flow must be of type Flow. 
  • Screen with 3 choices and store the result in screen choice fields : ProductType
  • Lookup to find records in product2 with contains ProductType and store them as variables (Id + name) 
  • Screen to display variables 
  • Activate the flow 
  • Add the flow to the opportunity screen using app builder.








Lightning Page:

A record page on Opportunity object. 
Drag and drop flow component on it and save.
Activate page.


Challenge 7

  • Change field type of field "Day of the Week" on robot object to formula text and use below formula.
  • CASE( MOD( Date__c - DATE(1900,1,6),7) , 0, "Saturday",1,"Sunday",2,"Monday",3,"Tuesday",4,"Wednesday",5,"Thursday",6,"Friday","")
  • Go on Process builder created in step 5.(You have to clone this Process Builder in order to make changes)
  • Go on 4th Node of closed Won opportunity.
  • Go on action create setup record.
  • Change formula of date field from [Opportunity].CloseDate + 180..
  • to
  • CASE(MOD([Opportunity].CloseDate + 180 - DATE(1900, 1, 7),7), 0, [Opportunity].CloseDate + 181, 6, [Opportunity].CloseDate + 182, [Opportunity].CloseDate + 180)
  • Save and activate.
Happy Coding!!!

39 comments:

  1. Challenge 5 Steps are incomplete , please provide it more accurate , challenge failed.

    ReplyDelete
    Replies
    1. Please share error you are getting from Trailhaed and where you find steps are missing.

      Delete
  2. Yes, doesn't work, stuck on step 5, getting the following error

    System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER. Also for first node criteria, what is the second field and value?


    ReplyDelete
  3. For 1st node second criteria checking opportunity account id not null.
    Make sure you are entering right values and fields. Please share screen shot of your error

    ReplyDelete
  4. hi, thanks for sharing ur work. its really helpful for cross checking our inputs.

    challange 5 doesnot work for me.

    what exact field and value u use in first node.

    i get the following error

    Challenge Not yet complete... here's what's wrong:
    There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301f400000025Lh. Flow error messages: An unhandled fault has occurred in this flow
    An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []


    thanks

    ReplyDelete
    Replies
    1. thanks for sharing your error. Make sure that you select created and updated on opportunity object when you create process builder. Also at the end of first node change stop to evaluate next criteria. I am updating screen shots in post.
      Make sure no other process builder are active except this one.
      Before checking challenge create some test records in you org and make sure that if you are using right information in fields. For example if you create opp for approval process testing make sure you enter amount greater than 100,000 and stage is prospecting. Because what i experienced is that Trailhead is testing your test data.
      Email me your screen shots if you still have issue.faiza.naz90@gmail.com

      Delete
  5. "Challenge Not yet complete... here's what's wrong:
    A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'."

    I have created the construction of the task and it is in the image. In the AssignedId field, it is referenced with [Opportunity] .OwnerId ??

    Thank you

    ReplyDelete
    Replies
    1. I had the same issue. Despite of all correct entries, i kept getting the same message. So, i started over again in a totally new DE org and it passed me.

      Delete
  6. no task should be assigned to account owner so it will be opportunity.Account OwnerId and make sure subject text is "Send Marketing Materials".
    Create a test record in system and check that task is getting created or not with mentioned subject. Trailhaed check task against this Send Marketing Materials subject

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  7. i am getting error in step number 7 it would be really helpful if you help me out

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Step 6 having error:

    There was an unhandled exception. Please reference ID: VRBCNAXM. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2

    Please help me.

    ReplyDelete
    Replies
    1. Dhaval,

      Can you please check that you are using right column names in record Lookup. After looking at error it looks like there is some problem with query. Please share screen shots of your flow.

      Delete
  11. Hi Faiza,

    Thanks for sharing this article.

    I am wondering where this Stage as Customer comes from in Step #5,first criteria of the Process. Since it is neither one of the standard values nor an addition they asked for as part of the module.Can you please help me understand this?

    ReplyDelete
    Replies
    1. It is opportunity account type = customer.

      Delete
    2. I am having same question. the only options are customer-direct, and customer-chanel

      Delete
    3. I ran into the same issue. "Customer" wasn't an option for me. Only "Customer-Direct" and "Customer-Channel". Do we need to create another value for the Customer Type field?

      Delete
  12. Could You please Post in short What are all criteria for the nodes in the Process builder

    ReplyDelete
  13. Some screenshot are not visible.Can you upload it.

    ReplyDelete
  14. populate manager field on your user record with some valid user. can you please tell me the steps to do this

    ReplyDelete
  15. Hi i followed your steps but am getting this error can u pls suggest me where am doing wrong
    Challenge Not yet complete... here's what's wrong:
    An Opportunity with the Stage 'Negotiation/Review' and the Amount greater than $100,000 was not successfully submitted for approval upon creation.

    ReplyDelete
  16. For step 7, I'm getting an error on Day of the Week that says the Date__c field cannot be used in this type of formula. What to do?

    ReplyDelete
  17. i am also getting the same error Date__c Field cannot be used in this type of formula

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Is Salesforce your passion... Looking for an extra-ordinary training session, new to coding, worried about placements
    We are here to help you
    "Attend the free demo (write to us on hello@diac.co.in for confirming your timing)
    Refer you friends and get great discounts
    Salesforce Developer and Admin Training along with Certification Training
    Highly optimized and easy to learn Salesforce online training which includes Salesforce ADMIN, DEVELOPMENT, LIGHTNING, BUSINESS ANALYST.
    Call us @91-9310096831

    ReplyDelete
  20. Challenge Not yet complete... here's what's wrong:
    Please check the custom fields on the Account object. Not all custom fields were found

    eventhough i have created proper custom fields (6),it throws this error.

    ReplyDelete
  21. Actually when i want to make Amount of won deals with rollback summery it s not show Amount field.In Field Aggregate section why.

    ReplyDelete
  22. A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'. can any one pls help me

    ReplyDelete
  23. A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'. I have tried many solutions, including starting from scratch on new play grounds multiple times. Please help me!! Thanks

    ReplyDelete
  24. A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'. help me

    ReplyDelete
  25. Challenge Not yet complete... here's what's wrong:
    Please check the custom fields on the Account object. Not all custom fields were found. plshelp me i am getting these error

    ReplyDelete