web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Error handling for importing xml files

(0) ShareShare
ReportReport
Posted on by

Hello,

I am currently importing orders via an XML port.

The orders from the XML files end up in a buffer table through the XML port.

Now I have written a codeunit that automates the import.

Via a task queue the orders from a folder are imported regularly.

But every now and then the import runs into an error. For this reason I need an error overview.

How can I implement this? Can I orientate myself here somewhere at the standard?

Thanks a lot ;)

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    What do you mean with error overview? Do you need to log failures on job queue task or do you need to create logs for data import errors?

    You could use telemetry for checking job queue failures or you can implement your own logging in business process by using TryFunctions and write custom logs.

  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at

    Hi, Maybe the information below can give you some new inspiration.

    https://demiliani.com/2021/10/07/dynamics-365-business-central-changing-the-way-of-throwing-errors/

    https://kepty.cz/2022/01/07/errorinfo-data-type-collectible-errors/

    https://yzhums.com/19630/

    Hope this will help.

    Thanks.

    ZHU

  • Community Member Profile Picture
    on at

    Thank you for your support ;)

    Perhaps I was not precise enough.

    All I really want is this: if the XML port runs into an error, then I want to write the error message to my buffer table (field: error text) so that the user can see why the import failed. After all, there is the function GETLASTERRORTEXT. I would then probably use this. But I don't know where to store it. In the XML port or in the code unit that calls the XML port?

    I also noticed that if I import several orders at once via job queue and one of the orders runs into an error, the whole import process is aborted. How can I prevent this? Of course, the job queue should then continue with the next order if the order previously ran into an error. How do I achieve that?

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans