How do I debug a batch job in D365FO?
How do I debug a batch job in D365FO?
1 answer
Write an answerIn a development environment, put the breakpoint in the batch/service code first, then make sure the batch task actually runs on the development machine you are debugging.
For classic DevTest/VHD environments, you may need to attach Visual Studio to the batch service process. If the batch service is not available to attach to, restart it and make sure the job is assigned to a batch group that runs on that machine.
For newer unified development environments, use the supported Dynamics 365 debugger workflow for that environment.
For async-only issues, I also add temporary targeted logging around the values I actually care about:
- Company
- Batch task / execution path
- Record IDs
- Parameters
- The branch of logic that ran
Do not log the entire world. Log enough to prove what happened.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer