parth desai
parth desai

Reputation: 49

Finished function is not working after Batch process finished

I am trying to call a function after the Batch operation that reads data from the database and generate a CSV file and auto-download it after the batch process finished. Here is my code snippet of the Batch API.

$batch = array(
  'operations' => $operations,
  'title' => t('Exporting the rheumatologist data.'),
  'init_message' => t('Export process is starting.'),
  'finished' => 'batch_export_finished',
  'progress_message' => t('Processed @current out of @total.'),
  'error_message' => t('Export process has encountered an error.'),
);
batch_set($batch);

and here is function that should be called.

function batch_export_finished(){
    alert("do something");
}

Upvotes: 1

Views: 305

Answers (0)

Related Questions