Is it Possible to use the Result of Callout1 in Callout2?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
I need to generate an access token with an HTTP callout and make use of that access token in another HTTP callout. These 2 HTTP callouts are future methods being called inside a Scheduled class. Is it possible to make use of the result from Callout1 for my callout2?
apex callout
add a comment |Â
up vote
3
down vote
favorite
I need to generate an access token with an HTTP callout and make use of that access token in another HTTP callout. These 2 HTTP callouts are future methods being called inside a Scheduled class. Is it possible to make use of the result from Callout1 for my callout2?
apex callout
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I need to generate an access token with an HTTP callout and make use of that access token in another HTTP callout. These 2 HTTP callouts are future methods being called inside a Scheduled class. Is it possible to make use of the result from Callout1 for my callout2?
apex callout
I need to generate an access token with an HTTP callout and make use of that access token in another HTTP callout. These 2 HTTP callouts are future methods being called inside a Scheduled class. Is it possible to make use of the result from Callout1 for my callout2?
apex callout
asked Aug 16 at 6:12
cookie
407
407
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31
add a comment |Â
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
Not in this case, because you can't even be sure of the order the two future calls are going to be executed. You're going to want to put both callouts inside of one @future
method and just call that one from the scheduled code.
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Not in this case, because you can't even be sure of the order the two future calls are going to be executed. You're going to want to put both callouts inside of one @future
method and just call that one from the scheduled code.
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
add a comment |Â
up vote
4
down vote
accepted
Not in this case, because you can't even be sure of the order the two future calls are going to be executed. You're going to want to put both callouts inside of one @future
method and just call that one from the scheduled code.
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Not in this case, because you can't even be sure of the order the two future calls are going to be executed. You're going to want to put both callouts inside of one @future
method and just call that one from the scheduled code.
Not in this case, because you can't even be sure of the order the two future calls are going to be executed. You're going to want to put both callouts inside of one @future
method and just call that one from the scheduled code.
answered Aug 16 at 6:29
Matt Laceyâ¦
20.5k543114
20.5k543114
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
add a comment |Â
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
I actually wasn't aware of whether the order was maintained, good to know!
â Matt Laceyâ¦
Aug 16 at 6:46
1
1
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
Actually, this document explains it better. I think there are some possible situations where f2 might beat f1 out of the gate, depending on a very specific set of circumstances. So ignore my previous comment. That said, it's probably very very rare that this happens... I've never observed it before.
â sfdcfox
Aug 16 at 6:54
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
I've always treated them like operator precedence in a new language, and don't assume anything :)
â Matt Laceyâ¦
Aug 16 at 6:56
1
1
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
Never thought it's okay to put 2 HTTP requests in one future method. It worked. Thanks for the suggestion.
â cookie
Aug 16 at 8:02
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f229056%2fis-it-possible-to-use-the-result-of-callout1-in-callout2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Why Callout1 and Callout2 are different future method?
â Saroj Bera
Aug 16 at 6:31