Options

XML PORT export

SteveSteve Member Posts: 81
Hello,

I have a customer that needs to export and email a xml "invoice" for all his sales per day. I have all the email code complete along with exporting the information to a file, but I haven't used the XML ports. Can anyone send me a code sample or walk me through calling, sending data and export data using a xml port?

thanks
Steve

Comments

  • Options
    kamranshehzadkamranshehzad Member Posts: 165
    This is what I do to export data from navision.

    1- create xml port
    2- write a code unit to export the data by calling xml port to a file or stream
    IF EXISTS('C:\XML_PO_OUT.XML') THEN
        ERASE('C:\XML_PO_OUT.XML');
    
    TESTFILE.CREATE('C:\XML_PO_OUT.XML');
    TESTFILE.CREATEOUTSTREAM(TestStream);
    XMLPORT.EXPORT(123456753,TestStream); 
    TESTFILE.CLOSE;
    //MESSAGE('XML CUSTOMER EXPORT COMPELETED');
    status := TRUE
    

    hope this helps.

    regards,
    KS
Sign In or Register to comment.