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. } }
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/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...
Add your code to delete all the record from Temporary Item Record.
Item.deleteall;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Genius!!
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book