XML-Port Export of data - unbound to a specific table
Jut
Member Posts: 72
Hi everyone,
I try to develop a web-service based on XML-Ports that actually allows me to define in NAV what data actually will be published as a web-service - I mean the data will not always be retrieved from the same table but the source could differ based on a setup-table in NAV. Of course I could just manually create the xml-tree in a Codeunit in NAV and publish that codeunit. Yet, I would rather prefer to use XML-Ports to have a strongly typed interface. The question now is (and I have to admit that I have never actually used XML-Ports in NAV and could not find anything about this in the "Developers-bible") if I have a chance to define a XML-Port not to be bound to specific tables but e.g. to use a temporary-record variable instead so that the xml-port could then populate that temporary-table OnPreXMLPort and export that accordingly. Since this temporary table could be populated from various different NAV-tables based on a setup-table in NAV, that flexibility would certainly be of great help.
Thanks a lot in advance!
Jut
I try to develop a web-service based on XML-Ports that actually allows me to define in NAV what data actually will be published as a web-service - I mean the data will not always be retrieved from the same table but the source could differ based on a setup-table in NAV. Of course I could just manually create the xml-tree in a Codeunit in NAV and publish that codeunit. Yet, I would rather prefer to use XML-Ports to have a strongly typed interface. The question now is (and I have to admit that I have never actually used XML-Ports in NAV and could not find anything about this in the "Developers-bible") if I have a chance to define a XML-Port not to be bound to specific tables but e.g. to use a temporary-record variable instead so that the xml-port could then populate that temporary-table OnPreXMLPort and export that accordingly. Since this temporary table could be populated from various different NAV-tables based on a setup-table in NAV, that flexibility would certainly be of great help.
Thanks a lot in advance!
Jut
0
Comments
-
You can't have strongly typed if it's dynamically set at run-time. Beware of making things too dynamic or you'll end up with a setup so complicated that it becomes a programming language of it's own!Senior Technical Consultant at Edan Business Solutions/Sphinx IT
Owner of V-Kwadraat (see my blog about Programming and my feed about Gaming!)0 -
I agree with Vincent, whilst it's technically possible to do what you are asking (XML ports are not bound to a table) you can easily create spaghetti bolognese.
The better solution is to define a data structure that covers what you need, and create tables in Navision that replicate this structure, once you have the data structure defined, the rest becomes easy.David Singleton0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
