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

Community site session details

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

XMLPORT not creating

(0) ShareShare
ReportReport
Posted on by 16
 
 
Hi ,
I've an XMLPORT whose declaration is :
 
XmlPort 50008 "MileStone XML"
{
    Direction = Export;
    Encoding = UTF8;
    FormatEvaluate = Xml;
    Format = Xml;
    UseDefaultNamespace = true;
   
    schema
    {
        tableelement(RigheBooking; "righe booking export")
 
XML is created correctly, but is missing the 
 
<?xml version="1.0" encoding="UTF-8"?>
 
any suggestion ?
Is there a way to add automatically ?
 
Fabrizio 
I have the same question (0)
  • GrisuX Profile Picture
    16 on at
    XMLPORT not creating
    Hi,
    Xmldeclaration is not recognized, even if i'm in 
    IT Business Central 22.1 (piattaforma 22.0.56191.0 + applicazione 22.1.55890.56216)
    onprem (but workins as we are in cloud)
     
    i seems that xmldeclaration should be available since :
     
    The XMLDeclaration property for XMLports was introduced in Microsoft Dynamics 365 Business Central 2020 Release Wave 2 (version 17.0).
     
     
    something wrong with visual studio ?
    or XMLdeclaration has been implemented in a newer wave release than 22 ?
     
    Fabrizio
     
  • Suggested answer
    PP-06061013-0 Profile Picture
    61 on at
    XMLPORT not creating
    Greetings , 
     

    By default, XMLports use the UTF-8 encoding standard, which is why the XMLport was created successfully. If you require a different encoding, it must be specified in the AL file.

    To include the XML declaration header automatically, you can enforce it in your AL file by setting the property below:

    Sample Example Below 
    xmlport 50100 MyXmlport
    {
        xmldeclaration = true; // Add this line
        schema
        {
            // ...existing code...
        }
        // ...existing code...
    }
     
  • Martin Dráb Profile Picture
    235,922 Most Valuable Professional on at
    XMLPORT not creating
    Moved from Integration, Dataverse, and general topics forum to Small and medium business | Business Central, NAV, RMS forum, because it seems to be about Business Central. Please let me know if you disagree.
     
    Note that the header <?xml version="1.0" encoding="UTF-8"?> is optional (in XML 1.0).

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,683 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,603

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,214

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans