function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger UpdatePropertyStatus on Contact(After insert){ set<id> conId=new set<id>(); for(contact c:trigger.new){ if(c.Status!=trigger.oldmap.get(c.Id).Status && c.Status=='Working'){ conId.add(c.Id); } } //property is child list<Property> pr= [select id ,status,contact.status from property where contactId in : conId]; if(pr.Size()>0){ list<property> pList=new list<property>(); for(Property p:pr){ if(p.contact.status=='Working'){ p.Status='Working'; pList.add(p); } } Update pList; } }
Please try below trigger or take reference, If it helps you then mark the best answer so it helps others. Thanks,
Lukesh