Activity Forums Salesforce® Discussions How to automatically add products to opportunity in Salesforce?

  • MOHIT

    Member
    June 15, 2020 at 3:14 pm

    1. Go to:
    Salesforce Classic: Click Setup | Create | Workflow & Approvals | Process Builder | New
    Lightning Experience: Click on the Gear Cog icon | Process Automation | Process Builder | New

    2. The process starts when: A record changes | Save.
    3. Click Add Object.
    4. Select Object: Opportunity.
    5. Start the Process: When a record is created.
    6. Criteria: No criteria—just execute the actions!
    Note: If you have multiple record types for opportunities, and you wish to add different products for different opportunities record types, then use the criteria:
    [Opportunity].RecordTypeID Equals ID <18-digit record type ID>
    The 18 digit record type ID can be found by navigating to:
    1. Gear icon | Setup | Object Manager | (object) | Record Type
    2. Click on the record type that you want to be added on the criteria

    Sample URL: https://ap15.lightning.force.com/lightning/setup/ObjectManager/Account/RecordTypes/0122v000001v0u5AAA/view
    (What you're looking for is the bold text)
    Note: The 18 digit record type ID can be found on the address link above and is only available in Lightning Experience.
    7. Click Add Action.
    8. Click Action Type: Update Records | Record: Select the Opportunity record that started your process.
    Criteria for Updating Records: No criteria—just update the records.
    9. Select an Existing price book: Field: Price Book ID Type: ID Value: <Price Book ID>
    10. Save and add a New Action.
    11. Click Action Type: Create a Records | Record Type: Opportunity Product.
    Set the following Field Values:
    a) Field: Opportunity ID Type: Field Reference Value: [Opportunity].Id
    b) Field: Product ID Type: ID Value: <Product ID>
    c) Field: Total Price Type: Currency Value: <amount>
    12. Repeat steps 10 and 11 to add more Products.
    a) Process will fail if the user tries to add a product that has already been archived
    13. Activate Process

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos