Problem XML structure
gonzy1981
Member Posts: 156
I'm in a Form, with this values:
No = R000001
ArrivalDate = 24/01/07
DepartureDate = 31/01/07
I did a XMLPort, and the result is this:
Code: Select all
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Booking>
<No>R0000001</No>
<ArrivalDate>24/01/07</ArrivalDate>
<DepartureDate>31/01/07</DepartureDate>
</Booking>
But i want, to have this:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Object type="Form" id="50000" caption="Booking" url="navision://client/run?servername=SERVER%5Csql2008%26database=NAV5_01%26company=CRONUS%20CZ%26target=Form%205000%26view=SORTING(Field1)%26position=Field1=0(R0000001)%26servertype=MSSQL">
<Row>
<Control type="TextBox" value="R0000001" width="2750" id="1" name="No" />
<Control type="TextBox" value="24/01/07" width="2750" id="2" name="ArrivalDate" />
<Control type="TextBox" value="31/01/07" width="2750" id="3" name="DepartureDate" />
</Row>
</Object>
Can you help me, to do my XML, to this way?
No = R000001
ArrivalDate = 24/01/07
DepartureDate = 31/01/07
I did a XMLPort, and the result is this:
Code: Select all
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Booking>
<No>R0000001</No>
<ArrivalDate>24/01/07</ArrivalDate>
<DepartureDate>31/01/07</DepartureDate>
</Booking>
But i want, to have this:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Object type="Form" id="50000" caption="Booking" url="navision://client/run?servername=SERVER%5Csql2008%26database=NAV5_01%26company=CRONUS%20CZ%26target=Form%205000%26view=SORTING(Field1)%26position=Field1=0(R0000001)%26servertype=MSSQL">
<Row>
<Control type="TextBox" value="R0000001" width="2750" id="1" name="No" />
<Control type="TextBox" value="24/01/07" width="2750" id="2" name="ArrivalDate" />
<Control type="TextBox" value="31/01/07" width="2750" id="3" name="DepartureDate" />
</Row>
</Object>
Can you help me, to do my XML, to this way?
0
Comments
-
Those properties are not stored as field values in any table, and I don't know of any way to retrieve that kind of information from an object. Defining the XML structure itself is easy, but I don't see how you could populate XML like that.0
-
You need to add appropriate "Attribute" for each "Element" into your XMLPort...0
-
Yeah like I said it's easy to create an XMLPort with that structure, but the data is going to be difficult. It looks like he's trying to put form information into the XML, and I don't know where you'd get that from.0
-
It seems like some direct use to generate web page. I assume that most of the data are fixed... but it is just guess... it is now on gonzy1981 if he will need something more. :whistle:
8)0 -
In the function CreateXML i need load the structure of the Form, to pass this .XML to a CODEUNIT403.LaunchApp
I'm trying to do this:
Rec.FINDFIRST;
REPEAT
CLEAR(Automation2);
CREATE(Automation2);
CLEAR(Automation5);
CREATE(Automation5);
CreateXML;
Automation2.load(NameXML);
//RecStyleShhet."Style Sheet ID" is a GUID
RecStyleSheet.SETRANGE("Object ID",7074236);
RecStyleSheet.FINDFIRST;
CODEUNIT403.SelectStyleSheet(0,FORM::"Draft",RecStyleSheet."Style Sheet ID");
CODEUNIT403.LaunchApp(Automation2,RecStyleSheet."Style Sheet ID",Automation5);
Automation5.save('C:\Automation5.XML');
SHELL('C:\Archivos de programa\Microsoft Office\Office12\WINWORD.EXE','C:\Automation5.xml');
UNTIL Rec.NEXT = 0;0 -
Hey Gonzy,
I was wondering if you have already found a solution to create the XML file ?
Kind regards
Steve0
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
- 250 Dynamics CRM
- 102 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

