Skip to main content

Notifications

Community site session details

Community site session details

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

XMLPort import without query

(0) ShareShare
ReportReport
Posted on by 225

Hi,

we want to Import a csv-file with a xmlport. The Import works fine but I have to choose the file every time. The file is always stored in the same folder. So we want to press the button and the import starts without a query. 

Here is the code for the button on a page. 

    procedure ImportXML()
    var
        ImportXmlFile: Text;
        XmlINStream: InStream;
        IsImported: Boolean;
        xmlPortXmlPort 50100;

    begin
        ImportXmlFile := 'C:\Users\xxx\Desktop\test.csv';
        UploadIntoStream('Import''''', ImportXmlFile, XmlINStream);
        xmlPort.SetSource(XmlINStream);
        IsImported := Xmlport.Import;
        if (IsImported = truethen
            Message('The import from XML is complete.')
        else
            Message(GetLastErrorText);

    end;
}
How can we make it work, that we can import the file without a query. I have already tried different things but nothing works. 
  • Suggested answer
    THE Italian Profile Picture
    on at
    RE: XMLPort import without query

    have you tried this blog post?

    robertostefanettinavblog.com/.../

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,234

#2
YUN ZHU Profile Picture

YUN ZHU 1,006 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 872

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans