A developer created an Apex class that updates an Account based on input from a Lightning web component. The update to the Account should only be made if it has not already been registered.
Java
account = [SELECT Id, Is_Registered__c FROM Account WHERE Id = :accountId];
if (!account.Is_Registered__c) {
account.Is_Registered__c = true;
// ...set other account fields...
update account;
}
What should the developer do to ensure that users do not overwrite each other’s updates to the same Account if they make updates at the same time?
Submit