Passing Parameters from Codeunit to XMLDataport

ChessExpert
Member Posts: 103
Hello Nav experts.
I wrote an XMLPort and created a codeunit to execute the XMLPort. And it is working fine. I just need to pass some information from the code unit to the XMLPort so that it can be added on the processing and be written to a table (General Journal Line).
In my code unit, I have created a global XMLPort variable like
Variable: xml_XMLImport
Type : XMLPort
SubType: JournalEntries
Part of my code looks like this.
TestFile.OPEN('NAV.xml')
TestFile.CREATEINSTREAM(TestStream);
xml_XMLImport.SETSOURCE(TestStream);
// xml_XMLImport.SETTABLEVIEW(Rec); // I can set this from codeunit, don't know how to retrieve it from the XMLPort
// HERE: I need to set some global variables in the XMLPort
xml_XMLImport.IMPORT();
TestFile.CLOSE;
Can you please let me know how to pass text or record variables to the XMLPort.
Thank you in advance.
I wrote an XMLPort and created a codeunit to execute the XMLPort. And it is working fine. I just need to pass some information from the code unit to the XMLPort so that it can be added on the processing and be written to a table (General Journal Line).
In my code unit, I have created a global XMLPort variable like
Variable: xml_XMLImport
Type : XMLPort
SubType: JournalEntries
Part of my code looks like this.
TestFile.OPEN('NAV.xml')
TestFile.CREATEINSTREAM(TestStream);
xml_XMLImport.SETSOURCE(TestStream);
// xml_XMLImport.SETTABLEVIEW(Rec); // I can set this from codeunit, don't know how to retrieve it from the XMLPort
// HERE: I need to set some global variables in the XMLPort
xml_XMLImport.IMPORT();
TestFile.CLOSE;
Can you please let me know how to pass text or record variables to the XMLPort.
Thank you in advance.
0
Answers
-
Modify the xmlport. Create a new function in the xmlport called Passparameters.
In your code called the function
TestFile.CREATEINSTREAM(TestStream);
xml_XMLImport.SETSOURCE(TestStream);
xml_XMLImport.PassParameters(yourValue);0 -
Thank you once again Rashed. It worked perfectly fine as per you advice.
Regards,
ChessExpert.0 -
You are welcome.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