XMLPort - element value not being brought into NAV?

jversusj
Member Posts: 489
good day all,
I am back with another XMLPort question! i did search the forum, but did not find anything relating to this particular issue.
I have an XML file to import that contains an Element = Extrinsic and Attribute=name. I have defined the XMLPort MinOccurs to Zero for the element since i can receive 0 - 10+ of these in a PO. When i watch my XMLPort through debugger, i am noticing that the Element variable is not pulling in its value, although the attribute is. the problem is, i need the value from the element.
Whew, that sounds confusing. let me show an example.
in the call behind the name attribute i have the following code (the booleans are place holders while i work on this) ORequestExtrinsicName is the datasource for name attribute and ORequestExtrinsic1 is the datasource of the Element:
when i watch in debugger, i can see the variable populating for the name attribute, but not for the element.
Interestingly enough, i have other Element-attribute pairs in my XMLPort that are functioning correctly. Any thoughts? ](*,)
edit: egads! i fixed it. i moved my code from behind the attribute to behind the element. it was actually going through the attribute code BEFORE it was initializing the element variable. okay. thanks for looking! hope this helps some other rookie out there.
I am back with another XMLPort question! i did search the forum, but did not find anything relating to this particular issue.
I have an XML file to import that contains an Element = Extrinsic and Attribute=name. I have defined the XMLPort MinOccurs to Zero for the element since i can receive 0 - 10+ of these in a PO. When i watch my XMLPort through debugger, i am noticing that the Element variable is not pulling in its value, although the attribute is. the problem is, i need the value from the element.
Whew, that sounds confusing. let me show an example.
here is part of my cXML document <Extrinsic name='PURCHASINGCENTER'>FAIRFAX</Extrinsic> <Extrinsic name='TAXABLE'>N</Extrinsic> <Extrinsic name='TANDC'>1) PAYMENT TERMS</Extrinsic> <Extrinsic name='RELEASENUM'>1</Extrinsic> <Extrinsic name='ACCOUNTNUM'>ABC123-001</Extrinsic> <Extrinsic name='EXTERNALPONUM'>286410</Extrinsic> <Extrinsic name='PODESC'>ORDERING COOL STUFF</Extrinsic> <Extrinsic name='CONFIRMATIONNUMBER'>EMAIL ADDRESS VALUE</Extrinsic>
in the call behind the name attribute i have the following code (the booleans are place holders while i work on this) ORequestExtrinsicName is the datasource for name attribute and ORequestExtrinsic1 is the datasource of the Element:
IF ORequestExtrinsicName = 'PURCHASINGCENTER' THEN ok := TRUE; IF ORequestExtrinsicName = 'TAXABLE' THEN BEGIN IF ORequestExtrinsic1 = 'N' THEN InXML."Tax Liable" := FALSE; IF ORequestExtrinsic1 = 'Y' THEN InXML."Tax Liable" := TRUE; END; IF ORequestExtrinsicName = 'TANDC' THEN ok := TRUE; IF ORequestExtrinsicName = 'RELEASENUM' THEN ok := TRUE; IF ORequestExtrinsicName = 'ACCOUNTNUM' THEN BEGIN CLEAR(Position); CLEAR(tempCust); CLEAR(tempShipTo); Position := STRPOS(ORequestExtrinsic1,'-'); IF Position > 0 THEN BEGIN tempCust := COPYSTR(ORequestExtrinsic1,1,Position-1); tempShipTo := COPYSTR(ORequestExtrinsic1,Position+1,(STRLEN(ORequestExtrinsic1))); InXML."Sell-to Customer No." := tempCust; InXML."Ship-to Code" := tempShipTo; END ELSE BEGIN InXML."Sell-to Customer No." := ORequestExtrinsic1; END; END; IF ORequestExtrinsicName = 'EXTERNALPONUM' THEN InXML."External Document No." := ORequestExtrinsic1; IF ORequestExtrinsicName = 'PODESC' THEN ok := TRUE; IF ORequestExtrinsicName = 'CONFIRMATIONNUMBER' THEN ok := TRUE;
when i watch in debugger, i can see the variable populating for the name attribute, but not for the element.
ORequestExtrinsic1 " " ORequestExtrinsicName "ACCOUNTNUM"
Interestingly enough, i have other Element-attribute pairs in my XMLPort that are functioning correctly. Any thoughts? ](*,)
edit: egads! i fixed it. i moved my code from behind the attribute to behind the element. it was actually going through the attribute code BEFORE it was initializing the element variable. okay. thanks for looking! hope this helps some other rookie out there.
kind of fell into this...
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