How do i select fields from different tables when writing re

matseke
Member Posts: 11
Hi there
How do i select fields from different tables when writing reports...
What i am trying to do is..
lets say the name of the table that i am working on is called e.g. Price line Table and i want to include maybe( e.g Price) as one of the fields in my report section
Remember that "Price" is from a different table.
I tried to define my other table in globals as a record
and
on AfterGetRecord()
PriceLine."Purchase Price" := Item."Price";
//this was just my idea, i'm not
even sure that this is a correct method to do it! :?:
I really dont know how to make it select the price from Item table
Pls help
How do i select fields from different tables when writing reports...
What i am trying to do is..
lets say the name of the table that i am working on is called e.g. Price line Table and i want to include maybe( e.g Price) as one of the fields in my report section
Remember that "Price" is from a different table.
I tried to define my other table in globals as a record
and
on AfterGetRecord()
PriceLine."Purchase Price" := Item."Price";
//this was just my idea, i'm not
even sure that this is a correct method to do it! :?:
I really dont know how to make it select the price from Item table
Pls help

0
Comments
-
Either through code or linking the Item table is the only two ways you can go.
Through Code...create a variable for Item table and use the Setcurrentkey and the GET or Find to link key fields in the two tables. Then use the Var. = Var feature.
Through the DataItem ...
list Item Table as a DataItem, then indent and go to properties and use the DataItemLike.0 -
Also use the SETRange or SETFILTER Feature.0
-
You first have to obtain the item that interests you.
You must have some field on PriceLine that refers to an item no.
Lets say that field is caled PriceLine."Item No".
Next step is retrieve that item from the Item table.
TWO WAYS:
0. PriceLine.TESTFIELD("item no.");//only if needed
1. Item.GET("item no."); //the best, because the item no is unique
2. Item.SETRANGE("No.", PriceLine."item No");//filter table
Item.FIND('-'); //retrieve record
3. Finally
PriceLine."Purchase Price" := Item."Price";
All this assumes that you define a variable named Item, of type Record, subtype = Item, and ofcourse a valid Item number is used."Simplicity is the ultimate sophistication."
Leonardo DaVinci0
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