function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gajanan KadamGajanan Kadam 

Facing an error while validating the lead object as below:

Hi All,

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, message: [].

Can anyone help me out this ? Your help will be appriciated :)

Thanks,
Gajanan

Rahul.MishraRahul.Mishra
Please check the validation rules on Lead object, deactivate them and verify again.

Thanks,
Rahul
Raj VakatiRaj Vakati
the issue because of the validation rule. Instead of deactivate validate rule update the data to meet the criteria and save it  
Gajanan KadamGajanan Kadam
Hi Rahul / Raj,
Thank you for your quick response :)
I have tried both way which are mentioned above but still facing the same problem. The scenario is that i need to risrtict the user to save new lead by state and counrty.
See the my validation formula on Lead Object :
====================================================
(ISBLANK(State)||NOT(CONTAINS("CA:TN",State)))
||
(ISBLANK(Country)||NOT(CONTAINS("US:USA",Country)))
=====================================================

Can you please help me ?

Thanks,
Gajanan
Rahul.MishraRahul.Mishra
Hi Gajanan,

If you want to create the record then you have to create the record in such a way that, it does not satisfy validation rule condition. So create the lead record where : State = "CA:TN" and  Country = "US:USA"

If you do so, validation condition will not be true and you will be allowed to create the record.
Mark my answer as best if it does solves your problem.

Thanks,
Rahul
Gajanan KadamGajanan Kadam
Hi Rahul,
Thank for you help but still stuck with same.
1. Requirement:Create a validation rule, two queues for leads, and a lead assignment rule as specified in the business requirements.
I have created the Queues and lead assignment rule also. But facing problem with validation rule :(
===========================================================================
Validation rule: 
State <> "CA:TN" && Country <> "US:USA" 
===========================================================================
It will fired when condition true else it will save the record.

but i am still gaetting error as :
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, message: []

Can you please help me :(

Thanks,
Gajanan