You need to sign in to do that
Don't have an account?
SFDC-NOOB
Is it possible to execute remote actions in order?
I am using javascript remoting. I have a situation where I need remote actions to execute in order.
The problem I am running into is the second remote action executes prior to the first one finishing. Seems like I've tried everything! Since remote actions are asynchronous, is it possible to execute them in order? What is the best way to do so?
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ChoptankRates.method1}',
document.getElementById('var1').value,
function(result, event) {
document.getElementById('var1').value = result[0].somevalue;
//Execute second remote action now.
}
);
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ChoptankRates.method2}',
document.getElementById('VAR1').value,
function(result, event) {
//do something here
}
);
The problem I am running into is the second remote action executes prior to the first one finishing. Seems like I've tried everything! Since remote actions are asynchronous, is it possible to execute them in order? What is the best way to do so?
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ChoptankRates.method1}',
document.getElementById('var1').value,
function(result, event) {
document.getElementById('var1').value = result[0].somevalue;
//Execute second remote action now.
}
);
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ChoptankRates.method2}',
document.getElementById('VAR1').value,
function(result, event) {
//do something here
}
);
[1] https://github.com/kriskowal/q
All Answers
[1] https://github.com/kriskowal/q