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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to use DotNet XmlDocument;

(0) ShareShare
ReportReport
Posted on by 65

Hi .

I try to create a new code unit , im copy ( codeunit 10145 "E-Invoice Mgt." ) but send ERROR

 XMLDoc: DotNet XmlDocument;
 XMLDocResult: DotNet XmlDocument;
 Environment: DotNet Environment;
DotNet 'XmlDocument' is missing 

Help Me please

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    This is for On-Prem or Saas ?

  • Armando Northware Profile Picture
    65 on at

    im use Business Central in Cloud .

  • Armando Northware Profile Picture
    65 on at

    pastedimage1580504976004v1.png

  • Lars Lohndorf-Larsen Profile Picture
    Microsoft Employee on at

    Hi, is this still an issue? I think that for SaaS, then this explains the situation:

    Quote:

    For cloud solutions .NET interop is not available due to safety issues in running arbitrary .NET code on cloud servers. With the AL Language extension, you can find AL types that replace the most typical usages of .NET like HTTP, JSON, XML,

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-dev-faq 

    I tried to make some very basic XML structure below, I know it's not pretty, but I hope it gives you some ideas to get started:

    XmlDocument.ReadFrom('<?xml version="1.0"?><XmlDocument><MyNode>Node 1</MyNode></XmlDocument>', VarXMLDoc);
    TempBlob.CreateOutStream(OStr);
    VarXMLDoc.WriteTo(OStr);
    Tempblob.CreateInStream(IStr);
    FileName := 'Myxml.xml';
    OK := DownloadFromStream(IStr, '', 'c:\Temp', '', FileName);

    var
    ReadFile: Codeunit ReadFile;
    VarXMLDoc: XmlDocument;
    OStr: OutStream;
    IStr: InStream;
    FileName: Text;
    TempBlob: Codeunit "Temp Blob";
    OK: Boolean;

  • Armando Northware Profile Picture
    65 on at

    Ok ..

    But  i has a copy for codeUnit and i need to replace this ..

    pastedimage1580855147273v1.png

    how to replace for the typical usages ?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 743 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 546 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 332 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans