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
SN SFSN SF 

How to Bypass Field Filter Validation Exception when the record is updated via Trigger

Hi -
I have a Field Filter Validation on Lookup Field CutonFieldA__c on Account Object . The Account is related to Custon Object B . When I make any updates to my related record (from Custom B) , Some of the fields on Account gets updated .

But suppose I have a value already populated on CutonFieldA__c  field on Account , which is now not satisfying the filter condition . If I try to update my related record (from Custom B) , I am able to Save the record succeffuly , but the values on the Account are not getting updated because of the FIELD_FILTER_VALIDATION_EXCEPTION Error .

This way user is not getting to know that the changes didn't flow to Parent recod . 
Can you please suggest me on this?

Regards,
SN SF

VinayVinay (Salesforce Developers) 
It is not possible for triggers to ignore validation rules without adding custom logic

You can try below steps as a workaround:
> Add a "Skip Validation" Checkbox field to the object
> Set the "Skip Validation" field to TRUE in a before trigger.
> Add logic to your validation rules so that they do not execute if "Skip Validation" is set to TRUE.

Else you can check using custom settings to bypass validation rule.

https://www.infallibletechie.com/2018/10/how-to-bypass-all-triggers-validation.html

Thanks,
Ashish Kumar YadavAshish Kumar Yadav
Hi SN SF,

Please remove the filter required radio button .and try you are able to do.

Please let me know if you have any queries.

if it is help please mark as the best answer.