Skip to main content

Notifications

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

How to use data exchange definition , using type Generic export

Posted on by 74

I create this XMLPort objet but I want to use data exhange definition , to  export a XMl File, I create a schema and dedItems.png but It don't create a XML file, and I am not sure how use that , I just want to do a easy example to understand how  export xml file using Data echange definition. because after that I will to develop something like a send invoice electronic, Could you help me? 

xmlport 50103 DCLSchemaItemsXml
{

    Format = Xml;
    Direction = Export;
    //TextEncoding = UTF8;
    UseRequestPage = false;
    //TableSeparator = '';//New line
    Encoding = UTF8;

    schema
    {
        textelement(Root)
        {
            tableelement(Integer; Integer)
            {
                XmlName = 'ItemHeader';
                SourceTableView = SORTING(Number) WHERE(Number = CONST(1));
                textelement(ItemNoTitle)
                {

                    trigger OnBeforePassVariable()
                    begin
                        ItemNoTitle := Item.FieldCaption("No.");
                    end;
                }
                textelement(ItemDescTitle)
                {

                    trigger OnBeforePassVariable()
                    begin
                        ItemDescTitle := Item.FieldCaption(Description);
                    end;
                }
                textelement(ItemTypeTitle)
                {

                    trigger OnBeforePassVariable()
                    begin
                        ItemTypeTitle := Item.FieldCaption(Type);
                    end;
                }
            }
            tableelement(Item; Item)
            {
                XmlName = 'Item';
                RequestFilterFields = "No.";

                fieldelement(No; Item."No.")
                {
                }
                fieldelement(Description; Item.Description)
                {
                }
                fieldelement(Type; Item.Type)
                {
                }
            }
        }
    }

}
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    RE: How to use data exchange definition , using type Generic export

    Hi, the information provided by Inge should be helpful.

    Just another idea, using Report Object to export XML file.

    More details: https://yzhums.com/23173/

    Hope this also helps

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans