Notifications
Announcements
No record found.
Hey team,
I have a form in which I save the data of the users which later is used to populate various tables through a batch job. This table has a field called "Status" which is initially "Pending" and changes to "Created" once the batch job has run successfully. If the batch job fails due to some reason the status is updated to "Failed". I want to show the front end user the Error which appears in the batch job logs when clicked on the status "failed". How can I do this? How can I show the errors of the batch job logs on the front end through x++?
Hi skd,
Can't you use standard batch history form to show the errors to users? I do assume there is no relation between your table and the exact execution job which had the error.
Hi André Arnaud de Calavon ,
Actually, batch job history can be seen by the technical users but my form is for non-techincal people so I just want to show them why the user creation failed. Is it possible?
As mentioned, there is no relation between a specific batch execution and your table. You can consider creating a log field on your table which would store the error details. Then it will be most easy to present the details to the functional user.
Hey André Arnaud de Calavon ,
I will create a log field on my table but how should I relate the batch job for that particular entry? Please can you elaborate how exactly can I achieve this?
HI skd,
While the table status is set to "Failed" in case of errors, can you not update the error log field in the table with the error from the batch job code?
Hey Gunjan Bhattacharyya,
I didn't really get what you are trying to say.
You have a table where the record status is "Pending" initially and is changed to "Created" when the batch job is run. In case of any errors, the status is changed to "Failed". Whenever there are errors and you update the status to "Failed", you can capture these errors and update the "Log" field as well in this table. You will need to include some additional logic in the batch job class to update the "Log" field with the error.
Thank you so much, I'm getting what you are saying also I was thinking how can I fetch the BatchJobID for a particular entry to show the logs.I will need batchjobID as the showLog() function needs the RecID from the BatchJobHistory table. Can you suggest me how should I get the batchJobId for a particular entry.
I am not sure if you can get the RecId of the BatchJobHistory table based on the record of the original table. Like Andre mentioned, you wouldn't have a direct relationship between your table and the BatchJobHistory table.
Okay, Thank you so much.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 544 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader