You can do it by the trigger. Please, refer to the trigger code for your reference. Hope it will help you.
trigger updateAccountDetails on Account (before update) {
// trigger before updation of the
List<Account> accList = new List<Account>();
// get list of all account which are upating
for(Account fetchAcc : Trigger.new) {
// loop to handle bulk account record updation
String sPhoneNum = String.valueOf(fetchAcc.Phone);
// convert phone integer into string for further calculation
if(!fetchAcc.Phone.isEmpty() && !fetchAcc.Name.contains(String.valueOf(sPhoneNum))) {
// when phone is not empty and number is not added in name
fetchAcc.Name = fetchAcc.Name +'_'+ sPhoneNum;
// update name in name_phoneNum format
}
}
}
Hey Kautubh,
You have to write the Trigger on Account.
If you provide me with more detail, i can help you with the code.
Regards,
Priya Ranjan
You can do it by the trigger.
Please, refer to the trigger code for your reference. Hope it will help you.
Regards,
Rama Gaikwad