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
Priyanka DumkaPriyanka Dumka 

trigger that will update all related contacts mailling addresses when account shipping address changes.

Trigger that will update all related contacts mailling addresses when account shipping address changes?
SwethaSwetha (Salesforce Developers) 
HI Priyanka,
You can take reference of the code snippet from https://salesforce.stackexchange.com/questions/369787/write-a-trigger-on-contact-and-fill-its-mailing-address-with-its-accounts-shipp to get started

https://developer.salesforce.com/forums/?id=9060G000000IBeVQAW

If this information helps, please mark the answer as best. Thank you
Shri RajShri Raj
trigger UpdateContactAddresses on Account (after update) {
    // Create a set to store the ids of the contacts that need to be updated
    Set<Id> contactIds = new Set<Id>();
    
    // Loop through the accounts that have been updated
    for (Account account : Trigger.new) {
        // Check if the shipping address has changed
        if (account.ShippingStreet != Trigger.oldMap.get(account.Id).ShippingStreet ||
            account.ShippingCity != Trigger.oldMap.get(account.Id).ShippingCity ||
            account.ShippingState != Trigger.oldMap.get(account.Id).ShippingState ||
            account.ShippingPostalCode != Trigger.oldMap.get(account.Id).ShippingPostalCode ||
            account.ShippingCountry != Trigger.oldMap.get(account.Id).ShippingCountry) {
            
            // Query for the related contacts
            for (Contact contact : [SELECT Id FROM Contact WHERE AccountId = :account.Id]) {
                contactIds.add(contact.Id);
            }
        }
    }