Notify Lightning Component when ApexBatch finishesAn interface extending a system interface causes process...
Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?
80's/90's superhero cartoon with a man on fire and a man who made ice runways like Frozone
Is there a way to count the number of lines of text in a file including non-delimited ones?
What should I call bands of armed men in the Middle Ages?
Why does the standard fingering / strumming for a D maj chord leave out the 5th string?
Does the rule that you cannot willingly end your move in another creature's space force or prevent certain actions?
What is a good class if we remove subclasses?
Regex crossword (sudoku?)
If you know the location of an invisible creature, can you attack it?
Split phone numbers into groups based on first digit
Simplification of numbers
How to take the beginning and end parts of a list with simpler syntax?
Help, I cannot decide when to start the story
Is there a standardised way to check fake news?
What can Amex do if I cancel their card after using the sign up bonus miles?
Do beef farmed pastures net remove carbon emissions?
How would timezones work on a planet 100 times the size of our Earth
My cat is a houdini
The cat exchanges places with a drawing of the cat
What kind of liquid can be seen 'leaking' from the upper surface of the wing of a Boeing 737-800?
Does Nightpack Ambusher's second ability trigger if I cast spells during the end step?
Are those flyers about apartment purchase a scam?
Are there really no countries that protect Freedom of Speech as the United States does?
Translation of "I don't have anything to smile about"
Notify Lightning Component when ApexBatch finishes
An interface extending a system interface causes process hangs?Is it a right approach to preform data processing in the finish method of batch Class?How to run Apex code every 5 minutes in 2016?Is there a way to determine future jobs scheduled by a user?Batch Apex class failure - CPU time limit exceededbatch apex terminated unexpectedlyEvent Relation SOQL Query Taking absurd amount of time first time, then a second any other time?How does Lightning Component Framework request boxcar'ing affect flows and transactions?Optimizing Batch Apex for large number of rows with minimal processingPlease provide your suggestion to Setup Alerts due to Integration failures
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
What is the best way to notify the Lightning Component when ApexBatch (invoked by LC action method) finishes?
Use case - My LC is invoking ApexBatch to offload complex data processing. I want to let the user (still on the LC page), that the batch has completed, and they can now view the result.
I don't want to poll the server every X seconds to check batch job status, so looking for alternate approaches, which will minimize the # of API calls.
apex lightning-aura-components batch
add a comment |
What is the best way to notify the Lightning Component when ApexBatch (invoked by LC action method) finishes?
Use case - My LC is invoking ApexBatch to offload complex data processing. I want to let the user (still on the LC page), that the batch has completed, and they can now view the result.
I don't want to poll the server every X seconds to check batch job status, so looking for alternate approaches, which will minimize the # of API calls.
apex lightning-aura-components batch
add a comment |
What is the best way to notify the Lightning Component when ApexBatch (invoked by LC action method) finishes?
Use case - My LC is invoking ApexBatch to offload complex data processing. I want to let the user (still on the LC page), that the batch has completed, and they can now view the result.
I don't want to poll the server every X seconds to check batch job status, so looking for alternate approaches, which will minimize the # of API calls.
apex lightning-aura-components batch
What is the best way to notify the Lightning Component when ApexBatch (invoked by LC action method) finishes?
Use case - My LC is invoking ApexBatch to offload complex data processing. I want to let the user (still on the LC page), that the batch has completed, and they can now view the result.
I don't want to poll the server every X seconds to check batch job status, so looking for alternate approaches, which will minimize the # of API calls.
apex lightning-aura-components batch
apex lightning-aura-components batch
asked 22 hours ago
Sidharth AgarwalSidharth Agarwal
483 bronze badges
483 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
That's what the Enterprise Messaging Platform is for. You place a lightning:empApi in your component, and subscribe to listen to an event. Then, in your finish method, you use EventBus. You'll need to make sure that you have some sort of unique identifier (e.g. the Apex Batch job ID) so a client knows that their job is finished as opposed to any other job that might be running on the same channel. Make sure you unsubscribe when you're done listening.
Note: round trips to the server don't actually "cost" API calls. They're free to use as frequently as you'd like, including polling the server for updates. Granted, using EMP is still the preferred method, whenever possible, but API costs should not be a concern for normal applications and components.
Thank you so much.
– Sidharth Agarwal
16 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "459"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273347%2fnotify-lightning-component-when-apexbatch-finishes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
That's what the Enterprise Messaging Platform is for. You place a lightning:empApi in your component, and subscribe to listen to an event. Then, in your finish method, you use EventBus. You'll need to make sure that you have some sort of unique identifier (e.g. the Apex Batch job ID) so a client knows that their job is finished as opposed to any other job that might be running on the same channel. Make sure you unsubscribe when you're done listening.
Note: round trips to the server don't actually "cost" API calls. They're free to use as frequently as you'd like, including polling the server for updates. Granted, using EMP is still the preferred method, whenever possible, but API costs should not be a concern for normal applications and components.
Thank you so much.
– Sidharth Agarwal
16 hours ago
add a comment |
That's what the Enterprise Messaging Platform is for. You place a lightning:empApi in your component, and subscribe to listen to an event. Then, in your finish method, you use EventBus. You'll need to make sure that you have some sort of unique identifier (e.g. the Apex Batch job ID) so a client knows that their job is finished as opposed to any other job that might be running on the same channel. Make sure you unsubscribe when you're done listening.
Note: round trips to the server don't actually "cost" API calls. They're free to use as frequently as you'd like, including polling the server for updates. Granted, using EMP is still the preferred method, whenever possible, but API costs should not be a concern for normal applications and components.
Thank you so much.
– Sidharth Agarwal
16 hours ago
add a comment |
That's what the Enterprise Messaging Platform is for. You place a lightning:empApi in your component, and subscribe to listen to an event. Then, in your finish method, you use EventBus. You'll need to make sure that you have some sort of unique identifier (e.g. the Apex Batch job ID) so a client knows that their job is finished as opposed to any other job that might be running on the same channel. Make sure you unsubscribe when you're done listening.
Note: round trips to the server don't actually "cost" API calls. They're free to use as frequently as you'd like, including polling the server for updates. Granted, using EMP is still the preferred method, whenever possible, but API costs should not be a concern for normal applications and components.
That's what the Enterprise Messaging Platform is for. You place a lightning:empApi in your component, and subscribe to listen to an event. Then, in your finish method, you use EventBus. You'll need to make sure that you have some sort of unique identifier (e.g. the Apex Batch job ID) so a client knows that their job is finished as opposed to any other job that might be running on the same channel. Make sure you unsubscribe when you're done listening.
Note: round trips to the server don't actually "cost" API calls. They're free to use as frequently as you'd like, including polling the server for updates. Granted, using EMP is still the preferred method, whenever possible, but API costs should not be a concern for normal applications and components.
answered 21 hours ago
sfdcfoxsfdcfox
282k14 gold badges231 silver badges482 bronze badges
282k14 gold badges231 silver badges482 bronze badges
Thank you so much.
– Sidharth Agarwal
16 hours ago
add a comment |
Thank you so much.
– Sidharth Agarwal
16 hours ago
Thank you so much.
– Sidharth Agarwal
16 hours ago
Thank you so much.
– Sidharth Agarwal
16 hours ago
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273347%2fnotify-lightning-component-when-apexbatch-finishes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown