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

Help in Trigger(Parent field updation based on chield record)
Hi All !!I have Written the following code to update Account custom field if Contact Status field is Finish,But I wanted to do if all the assosiated contact status finish then only it should be end.
Code is:
Code is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | trigger UpdateAccountStatus on Contact (after insert,after update) { List<ID> actListID=new List<Id>(); for(Contact con:Trigger.new) { if(con.Status__c=='Finish'&& con.AccountID!=Null){ actListID.add(con.AccountID); } } List<Account> acc=[Select Id,Name,Status__c from Account where Id=:actListID]; for(Account a:acc) a.Status__c = 'End'; update acc; } |
All Answers
Thank, let us know if it helps you and close your query with best answer if it helps you
Thanks a lot for replying but could you please explain your code a bit!!