importing Sales order and sales orderline!!!???

naranara Member Posts: 37
Hi,
I need som advise for solving that problem/issue.
I did develop a a.NET app that will communicate with Navisio 3.7 by using MSMQ and NAS.
I did managed export of Items/products from Navision, but I have problemwith import of orders and orderlines to Navision, since the navision has not XMLPORt( this was my first idea) so I think that I can make use of DATAPORT, is it a WRONG IDEA?
My idea is that my .NET app delivering a file( XML or TXT) that including Ortders and orderlines and my .NET app can call a codeunit that retrieve this file and this coseunijnt calling the proper DATAPORT to do this import job.
How realistic is this IDEA?
I am not that experienced in NAVISION so may be I am talking CREASY here.

Any help will be appreciated.

Comments

  • nunomaianunomaia Member Posts: 1,153
    That isn’t a so creasy idea. :mrgreen:
    It’s a common way to solve some problems of import / export
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • krikikriki Member, Moderator Posts: 9,110
    And to add something : NEVER import data directly into Navision tables from outside Navision. This because you can use the Navision-triggers. At best, you import the data into new tables and then have some codeunit/report/... to import it into the real tables.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DeviDevi Member Posts: 8
    Hai

    I am Devi.
    For one of our client some of the data from outside application should flow into navision.

    Basically purchase orders and sales orders should be imported/exported from/to navision.
    I am trying to use xmlports in navision,but this is the first time i am using them.so not so familiar


    Can anyone suggest me the bestway to do this and how to do this.

    Waiting for reply soon as it is little critical.

    Thanks and Regards,
    Devi.
  • DenSterDenSter Member Posts: 8,305
    If you're using NAS and MSMQ already, and don't have XMLPorts, that means you are on an earlier version. You can still use XML docs, you just have to program the parsing yourself. Check out the Biztalk codeunits for examples of how to do that. There's also an example in the download area here on mibuso if I'm not mistaken.

    Then the last thing you can do is search for a file called 'devguide.chm', it's somewhere on the product CD. This file has code samples to make NAS work, and IIRC there's also a section about using the XMLDOM automation.

    Use the search, because there are MANY postings about this subject from when we didn't have XMLPorts.
  • DeviDevi Member Posts: 8
    Hi

    I am using microsoft nav4.0 sp3 and with sqlserver option .

    I am able to use xmlports
    but dont know how to do ,can anyone just help me out .

    devi.
  • DenSterDenSter Member Posts: 8,305
    Take a look at the Biztalk codeunits, those use XMLPorts to import and export data. You'll also find plenty of examples if you search the forum.
  • amadeodamadeod Member Posts: 6
    Nara,
    one simple approach might be to directly ad-hoc insert-update data on the NAV's SQL tabel level (either on actual or staging tables!) and afterward you just call some codeunit to validate NAV's business logic triggers upon inserted records ...

    More serious longterm solution would of course be to use MSMQ & NAS interaction.

    Regards,
    A.
  • aboomaraboomar Member Posts: 47
    Devi wrote:
    Hi

    I am using microsoft nav4.0 sp3 and with sqlserver option .

    I am able to use xmlports
    but dont know how to do ,can anyone just help me out .

    devi.

    you can use XMLPort 8000 -- Purchase Order but you must create codeuint

    to import or export the data from or to XMLPort

    use this code in codeunit


    IF NOT EXISTS ('Path.xml') THEN
    ERROR ('xml document file does not exist');
    testfile.OPEN('Path.xml');
    testfile.CREATEINSTREAM(filestr);
    XMLPORT.IMPORT(8000, filestr);// you can change to export
    testfile.CLOSE;
    MESSAGE('Done');

    //filestr=InStream
    //testfile=File

    you can use this code to import and export any XMLport i mean if you create new XMLPort
Sign In or Register to comment.