You need to sign in to do that
Don't have an account?

if i only updated the account record old number to new number through trigger some error is coming
trigger AccountPhoneUpdate on Account (before Update)
{
Map<Id, Account>mapaccount = new Map<Id, Account>([Select Name, Phone From Account Where Id In : trigger.old]);
List<Account>updatedaccount = new List<Account>();
for(Account a : trigger.new)
{
Account oldphone = mapaccount.get(a.Id);
if(a.Phone != oldphone.Phone && a.phone !=Null)
{
updatedaccount.add(a);
}
}
update updatedaccount;
}
{
Map<Id, Account>mapaccount = new Map<Id, Account>([Select Name, Phone From Account Where Id In : trigger.old]);
List<Account>updatedaccount = new List<Account>();
for(Account a : trigger.new)
{
Account oldphone = mapaccount.get(a.Id);
if(a.Phone != oldphone.Phone && a.phone !=Null)
{
updatedaccount.add(a);
}
}
update updatedaccount;
}
update updatedaccount;
}
But Some Error is Coming in that Question
In a before update you don't need to explicitly call update on the records you want to modify. You're working on them before they go into the database, so you simply need to set the field values you want and that's it.
So no need to perform any DML in before context.
Thanks,
Abhishek Singh
i will completed my developer part in the salesforce then i doing one project in the developer part . please suggesting me which type of project will be doing in the developer part