XMLport to import text file - error integer table readonly

hiddentext
Member Posts: 45
I am trying to build a xmlport that can import a text file to customer table using integer table. I based the development on an existing xmlport 5900 Imp. IRIS to Area/Symptom Code.
I am getting an error " The integer table is read-only".
I am getting an error " The integer table is read-only".
OBJECT XMLport 50008 test2 { OBJECT-PROPERTIES { Date=05/24/09; Time=10:17:40 PM; Modified=Yes; Version List=NAVW16.00; } PROPERTIES { CaptionML=[ENU=Imp. IRIS to Area/Symptom Code; ESM=Imp. IRIS a µrea/C¢d. s¡ntoma; FRC=Imp. IRIS dans code zone/symp.; ENC=Imp. IRIS to Area/Symptom Code]; Format=Variable Text; } ELEMENTS { { [{87B38AED-8742-4994-AD88-E9510356BA42}]; ;Root ;Element ;Text } { [{EFA3FFFA-3B05-44BC-AFD3-65A7DE7FF1A8}];1 ;Import ;Element ;Table ; SourceTable=Table2000000026; Import::OnBeforeInsertRecord=VAR FaultArea@1000 : Record 5915; SymptCode@1001 : Record 5916; Item@1000000000 : Record 27; BEGIN WITH Item DO BEGIN INIT; "No." := Text1; Description := Text2; "Search Description" := Text3; MESSAGE('text3 %1', Text3); IF NOT INSERT THEN MODIFY; END; END; } { [{39423B71-CCD9-44B2-AFA9-09DA62D16A35}];2 ;Text1 ;Element ;Text ; Import::OnAfterAssignVariable=VAR Item@1000000000 : Record 27; BEGIN END; } { [{B5A56E94-25BD-48B7-8C20-6B9422DFB368}];2 ;Text2 ;Element ;Text } { [{C9D7C5C8-8FFE-46B3-87F9-FC88C7F19D29}];2 ;Text3 ;Element ;Text } } EVENTS { } REQUESTPAGE { PROPERTIES { } CONTROLS { } } CODE { BEGIN END. } }
0
Comments
-
you can use the actual Item table. Set it to temporary. Make sure nothing is validated on the elements.0
-
Thanks ara3n.
I tried using temporary table. I was able to insert to item table if there is only one row of record in the text file.
If I tried to insert more than one row. I get the error message.
Microsoft Dynamics NAV
Item No. '' already exists.
OK
I can't debug on RTC. is very frustrating...OBJECT XMLport 50008 test2 { OBJECT-PROPERTIES { Date=05/25/09; Time=[ 7:53:56 AM]; Modified=Yes; Version List=NAVW16.00; } PROPERTIES { CaptionML=[ENU=Imp. IRIS to Area/Symptom Code; ESM=Imp. IRIS a µrea/C¢d. s¡ntoma; FRC=Imp. IRIS dans code zone/symp.; ENC=Imp. IRIS to Area/Symptom Code]; Format=Variable Text; } ELEMENTS { { [{87B38AED-8742-4994-AD88-E9510356BA42}]; ;Root ;Element ;Text } { [{EFA3FFFA-3B05-44BC-AFD3-65A7DE7FF1A8}];1 ;Import ;Element ;Table ; SourceTable=Table27; Temporary=Yes; Import::OnBeforeInsertRecord=VAR Item2@1000000000 : Record 27; BEGIN WITH Item2 DO BEGIN INIT; "No." := Text1; Description := Text2; "Search Description" := Text3; MESSAGE('text1 %1', Text1); Item2.INSERT; END; END; Export::OnAfterGetRecord=VAR item@1000000000 : Record 27; BEGIN END; } { [{39423B71-CCD9-44B2-AFA9-09DA62D16A35}];2 ;Text1 ;Element ;Text ; Import::OnAfterAssignVariable=VAR Item@1000000000 : Record 27; BEGIN END; } { [{B5A56E94-25BD-48B7-8C20-6B9422DFB368}];2 ;Text2 ;Element ;Text } { [{C9D7C5C8-8FFE-46B3-87F9-FC88C7F19D29}];2 ;Text3 ;Element ;Text } } EVENTS { } REQUESTPAGE { PROPERTIES { } CONTROLS { } } CODE { BEGIN END. } }
0 -
After the following trigger
Item - Import::OnBeforeInsertRecord()
Add your code to delete all the record from Temporary Item Record.
Item.deleteall;0 -
it work perfectly. Thanks for you help0
-
you are welcome.0
-
ara3n wrote:After the following trigger
Item - Import::OnBeforeInsertRecord()
Add your code to delete all the record from Temporary Item Record.
Item.deleteall;
Genius!!Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0
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