Loading

How to get field dependency to work during Lead conversion in Salesforce

게시 일자: Aug 25, 2025
상세 설명

An organization is tracking memberships in a custom object (Membership__c) and the membership record is generated when a 'Member' Lead type is converted. 
The Member lead record has a controlling picklist field called 'Membership Tier' and a dependent picklist field called 'Membership Price' and the similar dependency exist on the membership object. There is also a field called 'Lead Type' that has 'Member' as one of the picklist values that denotes that it is a membership lead. 
While lead conversion, the organization Is facing issues bringing these dependency field values from Lead record to the membership object dependency fields. 

솔루션

We are going to create a Record-Triggered Flow for this use case.

 

Note: Make sure Controlling and Dependent picklist fields (i.e. Membership Tier and Membership Price) on both Lead and Membership object have the same picklist values and dependencies.

 

For instance:
'Membership Tier' has picklist values ('Tier A', 'Tier B') and 'Membership Price' has picklist values ('Value 1', 'Value 2', 'Value 3', 'Value 4').


If on Lead object, the dependency is set in a way that if you select 'Tier A' on the 'Membership Tier' field, you can see 'Value 1' and 'Value 2' are available under the 'Membership Price' field and if you select 'Tier B' on the 'Membership Tier' field, you can see 'Value 3' and 'Value 4' are available under the 'Membership Price' field.


On the 'Membership' object, if the dependency is set in a way that if you select 'Tier A' on the 'Membership Tier' field, you can see 'Value 1' , 'Value 2' and 'Value 3' are available under the 'Membership Price' field and if you select 'Tier B' on the 'Membership Tier' field, you can see 'Value 4' are available under the 'Membership Price' field.


Now, if a 'Member' lead type is converted having the 'Tier A' on the 'Membership Tier' field and 'Value 3' is selected under the 'Membership Price' field, then the Flow will fail and throw an error "We cannot convert this lead because some values are restricted on the contact, account, or opportunity. Ask your admin to check the field mappings."

 

So, make sure the Controlling and Dependent picklist fields match on both the objects.


In order to create a Record-Triggered Flow, follow the steps provided below:

Step 1: Login to your Salesforce account. Click on the Gear Icon in the upper right corner of your screen and select Setup

01.png

 

Step 2: From the Quick Find box, search for Flows and select the New Flow button

02.png

 

Step 3: Select Record-Triggered Flow and hit the Create button

03.png

 

Step 4: Once the Flow canvas opens, set up the trigger on the Lead object (which is our source object). The trigger is set to fire whenever a lead is converted and 'Member' Lead Type (Lead_Type__c) value is selected

 

Here, the Lead Type is a custom picklist field on the Lead object where one of the picklist value is 'Member' denoting that it is a Membership type Lead.


In the Start element, provide the following values:

ObjectLead
Trigger the Flow whenA record is updated
Entry Conditions (Condition Requirements) All Conditions Are Met (AND)
Logic (IsConverted    Equals    True)    AND    (Lead_Type__c    Equals    Member)
When to run the Flow for updated records  Only when a record is updated to meet the condition requirements
Optimize the Flow for   Action and Related Records

 

04.png

 

Step 5: As the trigger is set on the Lead record, now bring the Create Records element on the canvas which will be used to create the Membership record on the conversion of a 'Member' Lead type

 

In the Create Records element, substitute the following values:

Label

Create Membership Record (Provide any suitable name. We have selected Create Membership Record)

Description Provide any suitable description (Note: It's not required but it's a best practice to provide descriptions)
How Many Records to CreateOne 
How to Set the Record Fields Use separate resources and literal values
ObjectMembership
Set Field Values for the Membership Account__c                        <--    {!$Record.ConvertedAccountId}
Membership_Tier__c       <--    {!$Record.Member_Tier__c}
Membership_Price__c     <--    {!$Record.Membership_Price__c}

 

Step 6: Now connect the Start element and the Create Records element we used so that the connection will be set up

 

05.png

 

Step 7: In the top right side of the canvas, select Save button and provide the suitable Flow name (It is a best practice to provide descriptions)

 

06.png


Step 8: Finally, click on the Activate button available next to the Save button to activate the Flow

07.png

_____________________________________________
Written by: 
Ajaypreet Singh Saini | Salesforce Answers Leader
Ajaypreet Singh Saini is working as a Salesforce Implementation Specialist at Grantbook. Prior to Grantbook, Ajaypreet served as a Salesforce Administrator for 2 years working on Sales Cloud where he was responsible for configuring and administrating complex processes and maintaining security of Salesforce Instance.


Submissions reflect only the opinions of the user who made available the Submission and not the opinions of Salesforce, regardless of whether the user is affiliated with Salesforce, and may contain or constitute products, services, information, data, content and other materials made available by or on behalf of third parties ("Third Party Materials).  Salesforce neither controls nor endorses, nor is Salesforce responsible for, any Third  Party Materials, including their accuracy, validity, timeliness, completeness, reliability, integrity, quality, legality,  usefulness or safety, or any applicable intellectual property rights. Any Submissions made available through any message board or forum in response to posted questions, or that otherwise purports to answer any questions, including any questions about Salesforce or Programs, are made available for your general knowledge only and should never be relied upon as answers to your specific questions (even if an answer is marked as a “best” answer or with any similar qualifications). You should always contact Salesforce support for answers to your specific questions. Salesforce has no control over Submissions, and is not responsible for any use or misuse (including any distribution) by any third party of Submissions.

If you have questions, tap into the wisdom of our entire Trailblazer Community here: https://trailhead.salesforce.com/trailblazer-community/feed
 

Knowledge 기사 번호

001128141

 
로드 중
Salesforce Help | Article