Skip to main content
Hi Team,

I am updating a Opportunity record field from another filed from a custom object, when i update custom field from the custom object am getting FIELD_FILTER_VALIDATION_EXCEPTION error in custom object.

This is the error message that i am getting when i update the custom object record.

Error Message : 

Error: Invalid Data. 

Review all error messages below to correct your data.

Apex trigger PrimeBaseRate caused an unexpected exception, contact your administrator: PrimeBaseRate: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 1 with id 006g00000095GZsAAM; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Existing_Lender__c]: Trigger.PrimeBaseRate: line 26, column 1

Here, the trigger we are using,

 

trigger PrimeBaseRate on Prime_Rate__c (after update, after insert) {

Static Double x;

for(Prime_Rate__c pr : trigger.new){

x= pr.Prime_Base_Rate__c;

}

System.debug('the vaulue of field is '+x);

//created a new list for bulkifying

list<opportunity> op = new list <opportunity>();

//running for loop for entire table.

for(opportunity op1 : [select id, Base_Rate__c from opportunity where isclosed=false]){

//changing the value of the field with the static variable.

op1.Base_Rate__c=x;

op.add(op1);

}

update op;

}

Can any one modify this code and help me?

Thanks & Regards,

Karthikeyan Chandran

+91-9944676540

 
4 answers
0/9000