Create a validation rule
To prevent lead source for being overwritten, create a validation rule in Salesforce. Navigate to the lead object > validation rules > new and enter the required information.
To run the validation rule if the lead source is changed and if the current value is not empty use this as your error condition formula.
1 |
ISCHANGED( LeadSource ) && (PRIORVALUE(LeadSource) <> "") |
You might want to allow some users to update the lead source field. For example, a marketing manager might need to update this field to correct data. To run the validation rule if the lead source is changed, if the current value is not empty AND allow a particular user alias to bypass the validation rules, use this as your error condition formula.
1 |
ISCHANGED( LeadSource ) && (PRIORVALUE(LeadSource) <> "") && !($User.Alias = "JMolb" ) |
You can also bypass the validation rules by using the user role ID, like this:
1 |
ISCHANGED( LeadSource ) && (PRIORVALUE(LeadSource) <> "") && !($User.UserRoleId = "00E36000000EJ8m" ) |
Activate and test
Activate your validation rule and test it by updating the lead source for a lead that already has a value. You should see an error message when saving the record.
Do another test by creating a new lead. Fill out the lead source field to ensure that you have the ability to update the field.
Questions?
Send me a tweet @jennamolby, or leave a comment
Hi again Jenna, my doubts have to do with your posts on UTM Parameters:
Maintain the initial value upon subsequent form submissions (checked)*
* checking this will ensure that the UTM parameters will not be overwritten (first touch only).
I understand this is a way to keep the original value in the Lead Source field, but then if we want to keep capturing UTM parameters on multi touch level, does it mean that by checking this box the values would just populate one after the other and can we then see them all in Lead Source in Salesforce or would the latest value overwrite it? Thank you.
Hi Tanya, Yes, that’s correct it will overwrite it with the latest value.
Hi Jenna, we like to use this method to prevent Lead Source field in Salesforce from getting overwritten. But, would this method also work for leads coming in from Pardot, whereby the Source field is automatically populated and synced with the Lead Source field? For example, if the lead’s referral URL contains UTM parameters and we capture source=Google Ads, but few months later the same prospect completes a webinar registration form and the referral URL contains UTM parameter for source=LinkedIn, would the validation rule prevent the original lead source from getting overwritten?
Hi Tanya, Yes, it should prevent Pardot’s source field from being overwritten IF the sync behaviour for your source field is set to “If Pardot and Salesforce values differ when data sync occurs: Use Salesforce’s value”. What this will do is look at the Pardot field value and change it back to the Salesforce field value (first touch) if the values do not match.