dataport - Find a specific record and populate fields

Dreamweaver33_1998
Member Posts: 6
For Tectura Project as part of our Navision 4.0, I want to write a dataport that says:
Find this position number. Then create a new level. Then create several new positions using these item numbers and quantities, etc.
Can someone tell me how to write a regular Navision dataport that says:
Find this particular record. Then populate these fields with this information.
Find this position number. Then create a new level. Then create several new positions using these item numbers and quantities, etc.
Can someone tell me how to write a regular Navision dataport that says:
Find this particular record. Then populate these fields with this information.
0
Comments
-
As Dataport imports Data from a Textfile you could try to write all the Datafields in temporary Variables without writing them directly into the table - which seems to be impossible in your case.
Write your code manually in the On after Import Trigger and use the values stored in the temporary filled Variables.
Hope this may help you.0 -
I always use an array of text to import the data then on afterimportrecrod I put my code that way I allways have control on what to validate and the sequence of validation and whether I can insert or modify.0
-
Set the properties of the dataitem AutoInsert and AutoUpdate to No. This will prevent the dataport from inserting or modifying any data.
Set the dataport fields as you normally would.
OnAfterImport, declare a local variable of the one you want to match.
if Variable.get(PK) then begin
//set fields here
variable.modify;
end;
You don't need any more code than that, no arrays or temporary variables.
-a0 -
It may be a spupid question but
How to do that ? Insert in a temporary array?
Is there a special keyword such as "Entier" in French for Integer.
Thanks0 -
Hello Slapin Here is the dataport code example.
OBJECT Dataport 50025 Import Item test { OBJECT-PROPERTIES { Date=03/14/06; Time=[ 9:17:15 AM]; Modified=Yes; Version List=TECTURA, Pashby; } PROPERTIES { FieldStartDelimiter=<None>; FieldEndDelimiter=<None>; FieldSeparator=<TAB>; } DATAITEMS { { PROPERTIES { DataItemTable=Table2000000026; AutoSave=No; AutoUpdate=No; DataItemTableView=SORTING(Number); OnPreDataItem=BEGIN IF NOT CurrDataport.IMPORT THEN BEGIN Item.FIND('-'); SETRANGE(Number,1,Item.COUNT); END; END; OnBeforeExportRecord=BEGIN CLEAR(DataItem); Item.NEXT; DataItem[1] := Item."No."; DataItem[2] := Item.Description; END; OnBeforeImportRecord=BEGIN CLEAR(DataItem); END; OnAfterImportRecord=BEGIN IF Item.GET(DataItem[1]) THEN BEGIN Item.Description := DataItem[2]; Item.MODIFY; END; END; } FIELDS { { ; ;DataItem[1] } { ; ;DataItem[2] } { ; ;DataItem[3] } { ; ;DataItem[4] } { ; ;DataItem[5] } { ; ;DataItem[6] } { ; ;DataItem[7] } { ; ;DataItem[8] } { ; ;DataItem[9] } { ; ;DataItem[10] } { ; ;DataItem[11] } { ; ;DataItem[12] } { ; ;DataItem[13] } { ; ;DataItem[14] } { ; ;DataItem[15] } { ; ;DataItem[16] } { ; ;DataItem[17] } { ; ;DataItem[18] } { ; ;DataItem[19] } { ; ;DataItem[20] } { ; ;DataItem[21] } { ; ;DataItem[22] } { ; ;DataItem[23] } { ; ;DataItem[24] } { ; ;DataItem[25] } { ; ;DataItem[26] } { ; ;DataItem[27] } { ; ;DataItem[28] } { ; ;DataItem[29] } { ; ;DataItem[30] } { ; ;DataItem[31] } { ; ;DataItem[32] } { ; ;DataItem[33] } { ; ;DataItem[34] } { ; ;DataItem[35] } { ; ;DataItem[36] } { ; ;DataItem[37] } { ; ;DataItem[38] } { ; ;DataItem[39] } { ; ;DataItem[40] } { ; ;DataItem[41] } { ; ;DataItem[42] } { ; ;DataItem[43] } { ; ;DataItem[44] } { ; ;DataItem[45] } { ; ;DataItem[46] } { ; ;DataItem[47] } { ; ;DataItem[48] } { ; ;DataItem[49] } { ; ;DataItem[50] } { ; ;DataItem[51] } { ; ;DataItem[52] } { ; ;DataItem[53] } { ; ;DataItem[54] } { ; ;DataItem[55] } { ; ;DataItem[56] } { ; ;DataItem[57] } { ; ;DataItem[58] } { ; ;DataItem[59] } { ; ;DataItem[60] } { ; ;DataItem[61] } { ; ;DataItem[62] } { ; ;DataItem[63] } { ; ;DataItem[64] } { ; ;DataItem[65] } { ; ;DataItem[66] } { ; ;DataItem[67] } { ; ;DataItem[68] } { ; ;DataItem[69] } { ; ;DataItem[70] } { ; ;DataItem[71] } { ; ;DataItem[72] } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR DataItem@1000000000 : ARRAY [72] OF Text[1000]; Item@1000000001 : Record 27; BEGIN END. } }
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