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

Future method cannot be called from a future or batch method
hi
I have a trigger which will be fired under some condition.
It works perfect and fine if i just give insert.
If i also include update,I get error :
How can i get ride of this?
please help
System.AsyncException: Future method cannot be called from a future or batch method
structure your trigger like this
trigger XXXXX on XXXX (XXX insert, XXX update){
if(trigger.isInsert){
....Your code to run during insert
}else if(trigger.isUpdate({
....Your code to run during update
}
}
First case: When i create a case in salesforce ,I am creating a case in my third party (integration)when a particular checkbox is created.
When i check the checkbox,its calling a future call class from a trigger and the class stuff is being executed and case is also creating in my third party.
later if any updates happen in my salesforce case it will be updated in my third party too.
my another case: If i create a case and later come and update the checkbox to true,then it should create a case in my third party.
later if i make any update in that case,changes should be made in that created case,(Same as above)
If i use after insert,after update i am getting above error.
how can i solve this?
It works...I am able to create cases but each time trigger fires,cases are being duplicated .Any help:(