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

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

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 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
    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

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