Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Mention new feature by Microsoft


Problem

You get a runtime error on mobile with an error message from Business Central.

Solution

Step 1: Is it a known error message?

See Error Messages

Step 2:  Inspect the Callstack

The call stack points to the failing code, which is VERY helpful.

The source of the error can be:

...

The call stack is included in the error XML response and in the Mobile Document Queue.

The Request /Response shows also what data was exchanged between Mobile and BC.

Step 3: Could a third-party extension be the cause?

If you have other extensions installed, add-ons, or from your partner.

Try uninstalling them temporarily  Consider doing this in a sandbox (step 6) to avoid disrupting the business.

  • Go to: Extension Management
  • Select an extension
  • Select the three dots
  • Select Uninstall 

Does the issue change?

...

  • Is it a single document that cannot be processed?
  • Can you reproduce the issue by creating new documents? (Using a sandbox, step 3)

...

With a sandbox you can:

...

Info
titleIn-client performance profiling with rules

Microsoft has introduced in-client performance profiling with configurable rules in Business Central 2024 Release Wave 2 (BC25).

This feature, provided by Microsoft, allows profiling of different types of requests, including but not limited to web service calls for a selected user, such as those from Mobile WMS.

The feature described below was developed before Microsoft introduced this capability and is specifically tailored for profiling requests from Mobile WMS.

While both tools can be used to profile Mobile WMS requests, ensure they are not used simultaneously, as this will lead to conflicts and failure.

Introduction

Profiling allows you to collect data about performance and analyze this data with the goal of optimizing a certain area in the code or a certain process.

The AL Profiler for the AL Language extension for Microsoft Dynamics 365 Business Central 2022 release wave 1 (BC20) offers two types of profiling: instrumentation profiling and sampling profiling. Both types of profiling are based on a snapshot of running code. The instrumentation profiling is more accurate and provides more insight. The sampling profiling is less accurate but can provide faster insights into performance trends on code. 

Source: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-profiler-overview

Profiling Mobile WMS requests

The above methods are useful to analyze the performance of time-consuming processes done directly in the web client like Calculate Plan or generating reports or even re-processing requests from the Mobile Document Queue. However, re-processing requests should only be done for Lookups and GetPickOrders and other read-only document types. If you re-process PostPickOrder or other read/write document types, you will risk getting transactions posted twice with undesirable results.

To analyze the performance of any kind of Mobile Request you can enable automatic profiling for selected Mobile Users or Mobile Document Types:

Image Added

Enabling the profiler will only last for 15 minutes at a time and you can disable the profiler again if you wish to stop it earlier.

You find the data in the Performance Profiler Entries window:

Image Added

Image Added

From here you can download the .alcpuprofile file and examine it in either Visual Studio Code:

Image Added

or Business Central Performance Profiler:

Image Added

The result from the profiling is not an exact representation of the executed code and expect to both lack details and have orphaned elements which are placed incorrectly in the visualization. The level of detail and visual code structure is gathered by the core of Business Central and cannot be changed by Mobile WMS. However, the longer the profiled request is running, the more likely is it you will find any problematic code. It is therefore recommended only to analyze requests running for longer than 1 second.

OnPrem

For OnPrem environments there seem to be an undocumented feature to change the sampling interval for performance profiling.

For more information, please visit https://www.waldo.be/2022/09/30/setting-the-sampling-interval-for-in-client-performance-profiling-business-central/

Re-processing requests with profiler enabled

For read-only requests and requests in status error you can normally safely re-process them from the document queue using the standard approach by Microsoft.

Mobile WMS adds the ability the easy re-process requests with the profiler directly from the document queue using the action Process Documents with Sampling Profiler:

Image Added

After having processed the selected request(s) a zip file will be downloaded with the .alcpuprofil and the request and response files for further analysis.

Need better profiling?

The automated profiling described above is using sampling profiling. It is necessary to use instrumental profiling to get an exact profile of the executed code.

This, however, requires usage of Visual Studio Code and a snapshot profile and developer access to the Business Central environment.

Please visit https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-profiler-overview for additional information.

See also

Filter by label (Content by label)
showLabelsfalse
max5
spacesTFSK
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel = "troubleshooting" and label = "bc" and space = "TFSK"
labelsMobiControl lockdown locked administrator


Version History

VersionChanges
MOB5.40Introduced