You need to sign in to do that
Don't have an account?

Error Error: Compile Error: Variable does not exist: Province at line 4 column 113
trigger Account on Account (after update) {
set<id> fire =new set<id>();
for(Account hg:trigger.new){
if(hg.BillingStreet !=trigger.oldMap.get(hg.id)||hg.BillingCity!=trigger.oldMap.get(hg.id)||hg.BillingState/Province!=trigger.get(hg.id)||hg.BillingZip/PostalCode!=trigger.oldMap.get(hg.id)){
fire.add(hg.id);
}
}
list<contact> cnt;
if(fire.size()>0){
cnt=[SELECT name,AccountId FROM Contact where AccountId in:fire];
}
if(cnt!=null){
list<Contact>contr=new list<contact>();
for(contact von:cnt){
von.otherStreet=trigger.newMap.get(von.id).BillingStreet;
von.otherStreet=trigger.newMap.get(von.id).BillingCity;
von.otherStreet=trigger.newMap.get(von.id).BillingState/Province;
von.otherStreet=trigger.newMap.get(von.id).BillingZip/PostalCode;
contr.add(von.id);
}
if(contr.size()>0){
update.contr;
}
}
}
set<id> fire =new set<id>();
for(Account hg:trigger.new){
if(hg.BillingStreet !=trigger.oldMap.get(hg.id)||hg.BillingCity!=trigger.oldMap.get(hg.id)||hg.BillingState/Province!=trigger.get(hg.id)||hg.BillingZip/PostalCode!=trigger.oldMap.get(hg.id)){
fire.add(hg.id);
}
}
list<contact> cnt;
if(fire.size()>0){
cnt=[SELECT name,AccountId FROM Contact where AccountId in:fire];
}
if(cnt!=null){
list<Contact>contr=new list<contact>();
for(contact von:cnt){
von.otherStreet=trigger.newMap.get(von.id).BillingStreet;
von.otherStreet=trigger.newMap.get(von.id).BillingCity;
von.otherStreet=trigger.newMap.get(von.id).BillingState/Province;
von.otherStreet=trigger.newMap.get(von.id).BillingZip/PostalCode;
contr.add(von.id);
}
if(contr.size()>0){
update.contr;
}
}
}
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks