Dataport question

pvar
Member Posts: 157
Hi,
Is there a way I could export data from 2 related tables in either Fixed or Variable format to a text file? When I tried to link the tables by indenting the data items, I got a message(while compiling) that 'you indented data items but the file format is not UPDXML'
Is there a way I could export data from 2 related tables in either Fixed or Variable format to a text file? When I tried to link the tables by indenting the data items, I got a message(while compiling) that 'you indented data items but the file format is not UPDXML'
0
Comments
-
You can't indent dataports. If you want to export data from related tables, you need to program the values in the OnBeforeExport trigger and put it as a variable in your dataport fields as part of the line of data.0
-
Another way is to use a process-only report and use the File commands to write out the data.There are no bugs - only undocumented features.0
-
Thanks Denster & bbrown for your valuable suggestions.
But I doubt if I understood correctly what to do with Denster's option. Could you please elaborate the steps?
I am trying to get the information from Global Item and Global Item variant tables. Do I still need to list both tables as dataitems without indentation?0 -
DenSter wrote:You can't indent dataports. If you want to export data from related tables, you need to program the values in the OnBeforeExport trigger and put it as a variable in your dataport fields as part of the line of data.
What part do you not understand so we can help you better?
Do you know how to create variables?
for example I have a dataport using "Sales lines" but I need info from the item table so I can know if an item is currently "blocked"
Item.GET("Sales Line"."No.");
IF Item.Blocked THEN
BEGIN
MyStuff blah blah;
END;0 -
The part I don't understand is how we link the tables if we don't indent and also defining a variable as a data port field.
I am new to Navision and I think this is the first dataport I am trying to create.0 -
if you look at chapter 17 or 18 of the application designers guide it has a whole section on dataports. the Designers guide can be found on your product cd. if you can't find it - I can post a link where you can download it from. that's probably a good place to start. not just for dataports but for reports, forms, tables , etc etc0
-
That is where I first looked at it but I couldn't find anything about exporting data from related tables like this.0
-
Apparently you need the output to look a certain way,
You need all the info for each Item varient on 1 line?
Am I correct in this?0 -
Correct, what I am looking to see in the output is all the information from the item table and the variant code from the variant table in on line. So if you have an item with 5 variants I need 5 lines in the output with just the variant code different among the lines.0
-
so here's a simple sample of a dataport - this dataport exports;
Item table data:
1) Item.No.
2) Item.Vendor No.
3) Item.UPC Code
Item Variant Table Data
4) Item Variant.CodeOBJECT Dataport 50015 Item Varient Temp { OBJECT-PROPERTIES { Date=08/02/06; Time=[ 4:27:18 PM]; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table5401; OnBeforeExportRecord=BEGIN Item.GET("Item Variant"."Item No."); Exp_ItemNo := Item."No."; Exp_VendorNo := Item."Vendor No."; Exp_UPCcode := Item."Item UPC/EAN Number"; END; } FIELDS { { ; ;Exp_ItemNo } { ; ;Exp_VendorNo } { ; ;Exp_UPCcode } { ; ;Code } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR "Item Varient"@1102606001 : Record 5401; Exp_ItemNo@1102606000 : Code[10]; Exp_VendorNo@1102606002 : Code[10]; Exp_UPCcode@1102606003 : Code[10]; Item@1102606004 : Record 27; BEGIN END. } }
The output of this phoney item # is
"SW1041","111865","0000101010101","AB1"
"SW1041","111865","0000101010101","AB2"
sw1041 is the item #
111865 is the vendor#
0000101010101 is the upc code
& ab1 & ab2 are the two variants for this item
you can of course add/remove any fields YOU want.
Note; this is a sample using the Item Variant Table as the dataitem but You could switch it around to the item table depending on your needs.0 -
Thanks Savatage. It worked but there is one problem. If an item doesn't have a variant then I won't get that item in the output.0
-
Savatage wrote:Note; this is a sample using the Item Variant Table as the dataitem but You could switch it around to the item table depending on your needs.
It was to show you how to get the additional info you needed and how to use variables in a dataport0 -
Maybe you should run a dataport off of the Item Variant table, and get Item information as additional fields.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