Use these methods to debug errors that have stopped Mobile Documents from being processed, including for your custom development.
Use the debugger to:
View the erroring code and navigate the callstack
Set breakpoints before the error occurs
This page only provides an overview. Please refer to the MS documentation.
Prerequisites
Info
Regular debugging is only possible in a Sandbox. Copy your Production environment to a Sandbox as needed.
Attach and Debug-Next
Use this method to re-process existing erroneous Mobile Documents
with errors.
and view the erroring code.
Attach and Debug-Next (Reprocess existing requests)
Steps
Open Business Central
Select ❔ in the top right-hand corner.
Select "Help & Support"
Select "Attach debugger to this session"
Start “Regular Debugging” in Visual Studio Code
Use the Mobile Document Queue to Process the document with the error. See Debugging.
Attach and Debug-Next Webservice (Catch requests before processing)
Use this method
to catch Mobile Documents requests in real-time as they are processed.This is useful
when you need to debug
for
before a Commit happens.
Info
This method requires a mobile device to be connected to the environment you are debugging. Make sure the Test folder points to your testing Sandbox and drag a device to the Test folder.
Steps
Perform the steps from Attach and Debug-Next section
.
Modify the launch.json file:
Delete sessionId
Change breakOnNext to "WebServiceClient"
Start debugging
Wait for the console mesage Debugger will attach to the next session of type WebServiceClient
Trigger the error from the mobile device
See also
Filter by label (Content by label)
showLabels
false
max
5
spaces
TFSK
showSpace
false
sort
modified
reverse
true
type
page
excludeCurrent
true
cql
label = "troubleshooting" and label = "bc" and space = "TFSK"