function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rakhi B 10Rakhi B 10 

account address is change related custome object adress also change using trigger (update))

Hi Rakhi,

Below is trigger.Here Ticket_Details__c is my coustome object which is ahving look up relationship with account and is having Ticket_Address__c which will be updated if account billing address is changed.
trigger updateTicketAddress on Account (after update) {

   Map<id,Account> updateTicket =  new Map<id,Account>();
   for (Account{
     String oldBillingStreet = Trigger.oldMap.get(acc.Id).BillingStreet;
     String oldBillingCity= Trigger.oldMap.get(acc.Id).BillingCity;
     String oldBillingState= Trigger.oldMap.get(acc.Id).BillingState;
     String oldBillingPostalCode= Trigger.oldMap.get(acc.Id).BillingPostalCode ;
     String oldBillingCountry= Trigger.oldMap.get(acc.Id).BillingCountry;
   if(acc.BillingStreet!=oldBillingStreet ||acc.BillingCity!=oldBillingCity||acc.BillingState!=oldBillingState||acc.BillingPostalCode!=oldBillingPostalCode||acc.BillingCountry!=oldBillingCountry){
   List<Ticket_Details__c> lTicket =[select id,Account__c,Ticket_Address__c from Ticket_Details__c where Account__c in:updateTicket.KeySet()];
   List<Ticket_Details__c> lTicket2= new List<Ticket_Details__c>();
   For (Ticket_Details__c ticket:lTicket ){
       Account acc= updateTicket.get(ticket.Account__c);
       ticket.Ticket_Address__c = acc.BillingStreet +  + 
                                        acc.BillingCity + ','+ 
                                        acc.BillingState + ',' + 
                                        acc.BillingPostalCode + + 
   update lTicket2;


Please mark this as solution if this will help you. So that if any one has same issue this post can help