0

What I am looking for is a way to run a validation rule and have it stop in its tracks if the Company type is not filled out on new lead conversion. here is what I have written so far

ISCHANGED(IsConverted)
&& IsConverted = TRUE
&& ISBLANK(TEXT( Company_Type__c))
&& ISPICKVAL(LeadSource, "Web")

However, if I am linking it to an already existing account, I do not want the validation rule to fire.

How do I accomplish this

Require Validation for Converted Leads is turned on

2
  • the validation rule has to run on the Account -- and you need to map three fields from the Lead to the Account : (1) some signal that Account was created by lead conversion; (2) leadsource and (3) company_type__c
    – cropredy
    Dec 16, 2020 at 1:49
  • This worked thank you! Feb 24, 2021 at 17:35

2 Answers 2

0

the validation rule has to run on the Account -- and you need to map three fields from the Lead to the Account : (1) some signal that Account was created by lead conversion; (2) leadsource and (3) company_type__c – cropredy Dec 16 '20 at 1:49

0

When a Lead Conversion occurs, the transaction scope includes:

  • Creating or updating an Account
  • Creating or updating a Contact
  • Creating an Opportunity (optional)
  • Updating the Lead to indicate it is converted and the related accountId, contactId, opportunityId

Thus, 4 DML operations occur in the transaction and if any of them fail, the conversion fails

So, in order to distinguish between new v existing Account, the validation rule has to run on Account and have enough information within the Account fields to differentiate between new v existing:

Map three fields from Lead to Account:

  • Is_Created_By_Lead_Conversion__c (checkbox)
  • Company_Type__c
  • LeadSource__c

Then you can use Account Validation Rule

ISNEW()
&& Is_Created_By_Lead_Conversion__c
&& ISBLANK(TEXT( Company_Type__c))
&& ISPICKVAL(LeadSource__c, "Web")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .