We have a DOS Batch job which runs a multi-step process to:
- Delete all records from salesforce for a specific object (download IDs and then delete them using Data Loader)
- Deletes all records from a database table which mirrors the Salesforce data.
- Extracts data from a database and uploads the data to the Salesforce objects using Data Loader.
- Downloads the Salesforce data into the database table.
Recently, the first step has been failing with a QUERY-TIMEOUT error. If I rerun the process, it generally works OK without any other changes. This is being investigated, but is not my question.
My question is: How can I detect when step 1 (which uses Data Loader) in the batch file fails? If this fails, I do not want to proceed with the rest of the process, as this deletes the database data which is used elsewhere for reporting.
Does the Apex Loader set an ERRORLEVEL if it fails? How else can I determine that there was a failure?
Thanks.
Ron Ventura