You need to sign in to do that
Don't have an account?
Abraham kumar 4
Trigger to fire on update to send webservice notification
Hi All,
I am trying to wrie a trigger so that once any account name is edited It should get all the related contacts of that account and send a few fields of those related contacts as a webservice method to another class, i just need a proper trigger for this Please help me write this trigger, im done some as below but no working
Thanks
Abraham
I am trying to wrie a trigger so that once any account name is edited It should get all the related contacts of that account and send a few fields of those related contacts as a webservice method to another class, i just need a proper trigger for this Please help me write this trigger, im done some as below but no working
trigger Contactcallout2 on Account(after update) { Map<Id, Account> mapaccount = new Map<Id, Account>(); list<Contact> ListContact = new list<Contact>(); set<ID> accIds = new set<ID>(); for(Account acct : trigger.new) { acctIds.add(acct.Id); mapAccount.put(acct.Id, acct); } if(Name!=old.Name){ listContact = [SELECT c.id,c.Email,c.FirstName,c.LastName,c.phone,c.Title__c,c.accName,c.status__c AccountId FROM Contact WHERE AccountId IN : acctIds AND c.recordtypeID = '012D0000000BaFA']; } if(listContact.size() > 0) { for(Contact con : listContact) { WebServiceCallout.sendNotification(c.Id,c.Email,c.FirstName,c.LastName,c.phone,c.Title__c,accName,c.status__c); } } }
Thanks
Abraham
All Answers
Thanks
Abraham