Screen Flow Scenario – Create Contact or Opportunity or Case related to Account based on Choice
Answer
Select New Flow Button and then Select Screen Flow
Drag Screen and Select a picklist Value
Picklist choices have to be Contact, Opportunity, Case
We have multiple Choice options in resource type to select picklist value:
- Choice – A single value defined in the flow the user can choose
- Collection Choice Set – A set of values defined in the flow the user can choose from
- Record Choice Set – A collection of records that meet a set of criteria, similar to a Get Records element that the user can choose from
- Picklist Choice Set – A set of values that matches an existing picklist field in your org
We need to understand which option to choose. In this case we will choose Choice option as there is no field in salesforce database and we will create single values through ‘Choice’
We will create 3 choices -Contact , Case , Opportunity
Then we need to create Decision isContact, isCase, isOpportunity
This is output we will see by creating screen element to choose object, decision for creating contact, opportunity and case, Based on decision showing screen to users.
Contact Screen will have mandatory fields
Drag Create Record Element->Choose Contact -> Map Fields with Screen Fields
Choose Picklist Choice Set to show StageName field picklist values. This is because field already exist in database and we need to just select object and field. This can be done using picklist choice set.
Drag Create Record Element->Choose Opportunity -> Map Fields with Screen Fields
Drag Create Record Element->Choose Case -> Map Fields with Screen Fields
Final Result
Drag the Flow Component on the record page. Pass Recordid into a variable so we can pass the account to the flow
Outcome