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

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. 
I have the same question (0)
  • Suggested answer
    THE Italian Profile Picture
    on at

    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

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,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans