Guide users through creating an opportunity
Create an opportunity with user-entered information. For this unit, create the flow and add a screen that gets the required information from the user. Later hands-on challenges ask you to add logic and actions to the flow.
- Create a flow:
- Label: New Oppty
- API Name: New_Oppty
- Type: Screen Flow
- Create a new resource:
- Resource Type: Variable
- API Name: accountName
- Data Type: Text
- Tip: You can create resources from the Manager tab in the toolbox.
- Create a new resource:
- Resource Type: Record Choice Set
- API Name: accounts
- Object: Account
- Choice Label: Name (Account Name)
- Data Type: Text
- Choice Value: Id (Account ID)
- Field: Name (Account Name)
- Variable: {!accountName}
- Create a screen:
- Label: Oppty Screen
- API Name: Oppty_Screen
- Add a text component to the screen:
- Screen Component: Text
- API Name: Oppty_Identifier
- Add a date component to the screen:
- Screen Component: Date
- API Name: Close_Date
- Add a picklist component to the screen:
- Screen Component: Picklist
- API Name: Account
- Data Type: Text
- Choice: {!accounts}
- Connect the Start node to the screen.
- Save the flow.
Add logic to the flow
Set the new opportunity Stage to ‘Prospecting’.
Prework If you haven’t already done so, complete the challenge in the previous unit in this module before attempting this challenge. Otherwise, this challenge cannot pass (and the Trailhead fairy can’t get her wings).
- In the New Oppty flow:
Create a new resource:- Resource Type: Variable
- API Name: opptyStage
- Data Type: Text
- Note: You can create resources from the Manager tab in the toolbox.
- Create an assignment:
- Label: Assign Stage
- API Name: Assign_Stage
- Variable: {!opptyStage}
- Operator: Equals
- Value: Prospecting
- Connect the screen to the assignment.
- Save the flow.
Add an action to the flow
Use the information you collected in the screen and flow logic to create an opportunity.
Prework If you haven’t already done so, complete the challenge in the previous unit in this module before attempting this challenge. Otherwise, this challenge cannot pass (and the Trailhead fairy can’t get her wings).
- In the New Oppty flow:
Create a new resource:- Resource Type: Text Template
- API Name: opptyName
- Text Template: {!accountName} {!Oppty_Identifier}
- Note: You can create resources from the Manager tab in the toolbox.
- Add a Create Records element:
- Label: Create Oppty
- API Name: Create_Oppty
- Select Use separate variables, resources, and literal values
- Object: Opportunity
- Map CloseDate to {!Close_Date}
- Map Name to {!opptyName}
- Map StageName to {!opptyStage}
- Connect the assignment to the element.
- Save the flow.