I have 2 object A,B
A has 2 field id, name
B has 3 field id, name, ismatching(default 0)
Scenario is >> if I insert value in B , it should be compare B.name to A.name , if match is true then ismatching field update from 0 to 1,
I am using trigger for that but facing problem will you please suggest me .
here A is Whitelist__c
and B is CrawleLink__c
. and trigger is
trigger white_list_update on CrawleLink__c (before insert)
{
List <Whitelist__c> nam = [select name from Whitelist__c];
for(CrawleLink__c cc : Trigger.new) {
for(Integer i= 0; i<nam.size(); i++) {
String aa= nam[i];
if(aa==cc.Domain__c) {
cc.Whitelist__c = 1;
}
}
}
}