From Trigger on inserting I am making a callout (from method1 of class A) i.e by using @future annotation and updating the field of the same object on which the trigger called, with the values acknowledged by the callout.
I want to call another method (method2 of class A) and make callouts by using the values updated earlier by method1.
The problem is, if I am calling it from the method1 after finishing the updates(DML) its throwing "you have uncommitted work pending. please commit or rollback before calling out" error if I don't make it future method and its giving the error "Future method cannot be called from a future or batch method" if I make it future.
And if do not call it from method1 and call it directly from trigger, there are two ways. One is to call it from isUpdate portion by which it will be called automatically when DML of method1 occurs and again I will get the error "Future method cannot be called from a future or batch method". Second is to call it in isInsert portion but as both method1 and method2 are future methods then they'll be called asynchronously, so if method2 is got to call first then it cannot use the values that would be updated by method1.
P.S : Is there any way to call two methods from a trigger and in both the methods I am using callouts and I want to use values in second method after first method performs DML operation?