You need to sign in to do that
Don't have an account?
othmane
WS callout from trigger
Hello,
Force.com requires that when we call a WS callout method from a trigger we Must use the @future annotation for the WS callout method.
But @future methods are not allowed to have any Object as arguments. I need to pass 'Account' object arg to this method but force.com won't allow me.
is there a woraround or a new solution for the scenario i described above?
thanks
Is this an account that has been stored in the database? If so, pass the id and use a SOQL call to get the record from the DB. If not, you'll have to find some way to persist the information as the @future call is in a different transaction.
All Answers
Is this an account that has been stored in the database? If so, pass the id and use a SOQL call to get the record from the DB. If not, you'll have to find some way to persist the information as the @future call is in a different transaction.
Great ,thank you for reminding me about using Account.id to reference the Account in my WS callout method. Yes the Account exists in DB.in WS callout method i'm only doing Account read only operations.
So thanks for this good hint.
One question plz: Is Contact.Id of type Integer or String? or what type is it in apex?
The type is Id - you can also use a String and it will work.
Thank you .this works perfectly.