XMLport Import Text Element not clearing itself - still filled on next loop

bennyb
Member Posts: 4
Hello I got a problem while importing an xml file. Somehow I can't find anyone having the same problem on google ._.
So my structure is following
MLIST
- M
- DATA1
- DATA2
I do processing in the M - Import::OnAfterAssignVariable()
Now let's assume DATA1 is always filled and DATA2 like every third loop only. So it's filled in M1 and M4, but empty in M2 and M3.
My problem now is, that DATA2 gets a value in M1 and now has the same value in M2 and M3.
How can I prevent that without making a CLEAR for every variable that could be empty?
The element doesn't come in M2 and M3 - so it doesn't clear itself I think?
Like
M1
DATA1 (fills with 1)
DATA2 (fills with XYZ)
M2
DATA 1 (fills with 2)
DATA 2 is not provided, so it keeps the value of M1 DATA2 (XYZ)
M3
DATA 1 (fills with 3)
DATA 2 (fills with ASD)
Is there any workaround?
So my structure is following
MLIST
- M
- DATA1
- DATA2
I do processing in the M - Import::OnAfterAssignVariable()
Now let's assume DATA1 is always filled and DATA2 like every third loop only. So it's filled in M1 and M4, but empty in M2 and M3.
My problem now is, that DATA2 gets a value in M1 and now has the same value in M2 and M3.
How can I prevent that without making a CLEAR for every variable that could be empty?
The element doesn't come in M2 and M3 - so it doesn't clear itself I think?
Like
M1
DATA1 (fills with 1)
DATA2 (fills with XYZ)
M2
DATA 1 (fills with 2)
DATA 2 is not provided, so it keeps the value of M1 DATA2 (XYZ)
M3
DATA 1 (fills with 3)
DATA 2 (fills with ASD)
Is there any workaround?
0
Answers
-
If Data2 is globally defined variable, never clears itself.0
-
you can reset all field (DATA2.INIT) with INIT before import any fields VALUE0
-
I'm seeing the same issue in BC v14 on prem. If the prior data element had a value, but the current data element doesn't, the old data is kept in memory. I expect it to clear after each iteration of the record. Are we supposed to clear the data elements after we insert into the record?0
-
I'm seeing the same issue in BC v14 on prem. If the prior data element had a value, but the current data element doesn't, the old data is kept in memory. I expect it to clear after each iteration of the record. Are we supposed to clear the data elements after we insert into the record?
Yes, it seems there is no other way than doing a CLEAR yourself when you have no possibility to change the receiving xml. The best solution would be to receive all fields even when they're empty - as then it would be cleared by the empty value.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