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
A A 279A A 279 

Case Validation Rule error

System.DmlException: Upsert failed. First exception on row 0 with id 500R000000EIFi3IAH; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Symptom Reason is required. Please fill.: []
Stack Trace: Class.ExtrCaseCreationExtension.saveDraft: line 891, column 1 Class.ExtrCaseCollaboratorExtensionTest.testThatCollaboratorCanBeChangedOnDraftCase: line 775, column 1

I am getting this error while pushing the below validation rule to upper orgs

AND( NOT( ISCHANGED( Contributor_1_c ) ) , NOT( ISCHANGED( Contributor_2c ) ) , ISBLANK( TEXT( Symptom_Reason_c ) ),$Profile.Id <> "00e30000000byNI",
$Permission.Bypass_SymptomReason = FALSE )

Can anyone help me with this?
AnkaiahAnkaiah (Salesforce Developers) 
Hi ,

You need to insert the test data for Symptom Reason field  the ExtrCaseCollaboratorExtensionTest.testThatCollaboratorCanBeChangedOnDraftCase method.

If this helps, Please mark it as best answer.

Thanks!!

 
A A 279A A 279
Where do I need to insert the test data?
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi ,

Are you deploying only validation rule or validation rule with apex classes?

Go to the ExtrCaseCollaboratorExtensionTest class and search for testThatCollaboratorCanBeChangedOnDraftCase method then check the  line 775. 
At this line case was inserting but due the validation rule its not getting inserted. 

To resolve this issue, you need to insert the data for Symptom_Reason__c field for that case record.

If this helps, Please mark it as best answer.


Thanks!!
keniam cresti 6keniam cresti 6
Lowes Customer Satisfaction Survey is designed to get customers’ feedback, reviews, and suggestions that help them improve their products and services.
The TechieThe Techie
Hi,

Deactivate this validation rule or skip this validation for your situation
Dylan Hughes 12Dylan Hughes 12
Hi,
As i know to resolve this issue, you should make sure that whenever the conditions specified in the validation rule are true, the "Symptom Reason" field is not left blank. You can either update the validation rule to allow for empty values in specific scenarios or ensure that the field is always populated when the conditions are met and additionally, double-check if the field API name "Symptom_Reason_c" is correct and matches the actual field API name in your org. Make sure there are no typos or discrepancies in the field name.   https://www-myaccountaccess.com/