You need to sign in to do that
Don't have an account?
Future Method Error
We have an apex integration to an external system. A trigger calls two Classes.
Update failed. First exception on row 0 with id 0010v000007pcrVAAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.AsyncException: Future method cannot be called from a future or batch metho
Can someone help my developer and I solve this issue? I can provide the code for the trigger and the two classes.
- The first Class checks to see if the corresponding record exists in the external system. If it does not, the Class sends a create command to the external system and the record should be created.
- The second Class comes into play if the corresponding record already exists in the external system. If it does, the Class sends an update command to the external system
Update failed. First exception on row 0 with id 0010v000007pcrVAAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.AsyncException: Future method cannot be called from a future or batch metho
Can someone help my developer and I solve this issue? I can provide the code for the trigger and the two classes.
trigger AccountTrigger on Account (before insert, before update) {
if(Trigger.isBefore){
if(Trigger.isUpdate){
//Add first, which will check if it should add
ArchticsAccountAdd.archticsAddAccount(Trigger.new, Trigger.oldMap);
//Update second, will see if it should be updated
ArchticsAccountUpdate.archticsUpdateAccount(Trigger.new, Trigger.oldMap);
}
}
}