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

Let's consider i have 10 records in some object.Let's take the name field.if change the name in one record all record's name field should be changed.Could anybody let me know how to do it?

Hi Syamkishore, you can achieve this using a trigger. However, you need to consider the situations like 1. when there are multiple records where the name is being changed it will be an issue. 2. if there are millions of records updating on all records is not optimal solution .

Below is the same code on how you can achieve this.

trigger Travel_Namechangeonall on travel__c (after update) {
    list<travel__c> travelrecstoupdate=new list<travel__c>();
list<travel__c> travels=new list<travel__c>([select id from travel__c]);
    for(travel__c travel1:travels){      ;
    update travelrecstoupdate;