0

I have a validation rule on Opportunity that I want to fire only when a new opportunity is created without Lead Convert process.
It should not fire when an opportunity is created using Lead conversion.

I created a field on Opportunity 'Converted LeadID' which I am setting when the lead is getting converted (using a Process Builder).
And using this field in the Validation rule to distinguish between an opportunity created via conversion process and without-conversion process.

But it doesn't work. Validation Rule is firing every time. Seems like Converted LeadID gets updated after the validation rule.

How can I address this? (am using Professional edition)

Below is the rule

ISBLANK(Converted_LeadID__c)

  • Please edit your post to include your validation rule formula. – David Cheng Sep 9 at 4:26
  • done - ISBLANK(Converted_Opportunity_ID__c) – Maneesh Sep 9 at 12:59
  • your verbiage says you are setting via Lead Conversion mappings: Opportunity.Converted_leadId__c yet your VR is on Opportunity.Converted_Opportunity_id__c - seems like either a typo or the post needs an edit – cropredy Sep 9 at 22:41
  • updated my question. Converted_leadId__c is being set using a Process builder – Maneesh Sep 9 at 22:46
0

If you use process builder to set Converted_LeadID__c the VR is executed after the field is filled. So I think that your problem is maybe a problem with your "OR" and "AND" logic in your Validation Rule. Please share with us your complete validation rule.

You must write your VR like that :

ISBLANK(Converted_LeadID__c) AND ( [Paste here your previous VR content] )

0

Other reason possible concerning your problem : - You use a process builder from Lead object (when status = converted) to fill the field "Converted_LeadID__c" of the opportunity.

In this situation the problem will be :

  1. The opportunity is automatically created with the convertion process (opportunity VR are triggered)
  2. Your process builder try to edit the opportunity already created to add the Converted_LeadID__c

So your process builder edit an opportunity already existing so the VR is triggered before your process builder.

If you are in this situation one solution is :

  1. Create a technical checkbox on lead object "Is Lead Conversion" with default value = true
  2. Create a technical checkbox on opportunity object "Is Lead Conversion" with default value = false
  3. Map the both field on the "Map Lead Fields" setup
  4. On your opportunity validation rule use the condition "Is Lead Conversion = false" instead of ISBLANK(Converted_LeadID__c)
  • Don't hesitate to give me more information if my answer not solved your question. – David-IT Sep 17 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.