How to create and import xml file in navision

abhishekpareek
Member Posts: 150
Hi All,
My problem is follows:
1: I need to create the XML file for Purchase Order in Navision and than to import from Navision to some location say C drive.
2: Purchase order should include Purchase Header and Purchase Line.
Queries:
a) Can I use XML port to achive this?If yes then is there any reference about how to use XML port?
b) If point a is acievable then how to run the XML port in Navision.
Is there any other solution inspite of XML port?
Thanks in advance!
Regards,
Abhishek
My problem is follows:
1: I need to create the XML file for Purchase Order in Navision and than to import from Navision to some location say C drive.
2: Purchase order should include Purchase Header and Purchase Line.
Queries:
a) Can I use XML port to achive this?If yes then is there any reference about how to use XML port?
b) If point a is acievable then how to run the XML port in Navision.
Is there any other solution inspite of XML port?
Thanks in advance!
Regards,
Abhishek
0
Comments
-
Yes you can use XMLPort to create an XML document out of a PO. Take a look at the standard XMLPorts, there's one for PO's for Commerce Gateway, number 8000 in a standard US database.
XMLPorts are used inside C/CAL code, you can't run them directly from the object designer. For some examples take a look at the commerce gateway XML codeunits.
You can also write code to open and process XML documents, using the XMLDOM automation server. For samples take a look at the same codeunits in older versions that didn't yet have XMLPorts.0 -
It would be great if you could explain with example.Like if are using the existing XMPORT say 8000 then how we can export the data throw this XML port?
Thanks for help in advance!
Regards,
Abhishek0 -
I gave you directions to hundreds of code samples. Here, let me repeat myself:DenSter wrote:Take a look at the standard XMLPorts, there's one for PO's for Commerce Gateway, number 8000 in a standard US database.
For some examples take a look at the commerce gateway XML codeunits.
For samples take a look at the same codeunits in older versions that didn't yet have XMLPorts.0 -
I have finished export sales invoice into xml file and now I need to import it as a purchase order. Any idea how to do it :?:
Thanks0 -
Create a XMLPORT for Purchase Header and Purchase Line.Then call this XMLPORT for the sales invoice xml file.
Regards,
Abhishek0 -
thanks Abhishek
well I have already created XMLport for purchase header and line but dont know how to call this xml port for the sales invoice xml file0 -
I would start here....
Application Designers Guide
PART 8 XMLPorts
Chapter 21 XMLPorts-
XMLport Fundamentals
Designing XMLports
XMLport Examples
Validating Data
XMLports and Business Notification
Also, available in the download section
Xml Export 1.3i
viewtopic.php?f=7&t=1775
XML Import Sample v1.0i
viewtopic.php?f=7&t=22660 -
how to create temporary tables to receive header and lines of sales invoice?0
-
A) Please create an new xmlport for sales invoice header and sales invoice line.
Call xml file which you had created.
Steps to create the xml port:
1:First create the file object
2:Create the instream object
3:Call the open function with the path and file name of the xml file which you had created.
4:Call the Import function for xmlport object with the parameter as follows
a)XMLPORT ID
b)Instream variable
Example:
Filexml.OPEN(filepath\filename);
Filexml.CREATEINSTREAM(instreamobject);
XMLPORT.IMPORT(50001,instream); //for running th xml port without setting the filter for the record
Regards,
Abhishek Pareek0 -
temporary table are created in the following way:
1) Declare the record variable in Globals
2) Go to property for that variable and make temporary =yes
Regards,
Abhishek Pareek0 -
Thanks a lot and let me try it..0
-
Whats wrong with this code ?
ImportFile.OPEN('C:\Temp\Import.xml');
ImportFile.CREATEINSTREAM(INSTREAM);
XMLPORT.IMPORT;
ImportFile.CLOSE;
can i add these two lines
rec_PurchHeader.SETRANGE("No.", "No.");
XMLPORT.SETTABLEVIEW(rec_PurchHeader);
what about the INSERT or TRANSERFIELDS functions ? how and where i can use them ? :-k
I am desperate student ](*,) does anybody have an idea how to continue with this code to finish import from xml file?
I can attach my xml port for import if it helps
Thanks to anybody who can help0 -
The error is in the following code:
XMLPORT.IMPORT;
Correted one:
XMLPORT.IMPORT(XMLPORTNUMBER,INSTREAM);
XMLPOARTNAUMBER ->The object ID of the XMLPORT which needs to be run for importing the XML records.
Regards,
Abhishek Pareek0 -
the ID of my xml port is 1
but i need to add some more lines i think since tha data must be imported somewhere.. e.g. temporary tables or some variables of a type RECORD..
i am really desperate
ImportFile.OPEN('C:\Temp\Import.xml');
ImportFile.CREATEINSTREAM(INSTREAM);
XMLPORT.IMPORT(1,INSTREAM);
ImportFile.CLOSE;
do you think this will work ??0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions