One-to-many table relation

illi4
Member Posts: 25
Dear colleagues,
Could you please advice if it is possible somehow to do one-to-many table relation in Nav (so, to get information from several tables in OnLookup)? I think that it is not possible, but I am not sure. Right now I can see only one way - to create temporary table and display it on OnLookup trigger.
Thanks.
Could you please advice if it is possible somehow to do one-to-many table relation in Nav (so, to get information from several tables in OnLookup)? I think that it is not possible, but I am not sure. Right now I can see only one way - to create temporary table and display it on OnLookup trigger.
Thanks.
0
Comments
-
And how do you expect to later know which table the original data came from ?0
-
illi4 wrote:Could you please advice if it is possible somehow to do one-to-many table relation in Nav (so, to get information from several tables in OnLookup)? I think that it is not possible, but I am not sure. Right now I can see only one way - to create temporary table and display it on OnLookup trigger.
Are you talking about a field that works similar to the No. field on the sales line for instance, where the relationship is different based on the value of another field (the Type field in that case)?0 -
If you want your lookup to function on multiple tables, the field should have a conditional table relation. So you'd set another, probably Option, field to a vale (like Customer, Vendor, Bank Account). The actual field that you are performing the lookup on would have this conditional relation based on the other field.
Otherwise, as was pointed out, you will have no idea where the data came from and may have data issues later on.0 -
Or perhaps Like what I added to my customer Ledger Entries "Document No."
Depending on the "Document Type" the "Document No" Lookup goes to a different form.
Either (Credit , Invoice or Payment)OnLookup(VAR Text : Text[1024];) : Boolean CASE "Document Type" OF "Document Type"::"Credit Memo": BEGIN CLEAR(PostedCreditForm); PostedCreditInv.SETFILTER(PostedCreditInv."No.","Document No."); PostedCreditForm.LOOKUPMODE(TRUE ); PostedCreditForm.SETTABLEVIEW(PostedCreditInv); PostedCreditForm.RUNMODAL; END END; CASE "Document Type" OF "Document Type"::Invoice: BEGIN CLEAR(PostedSalesForm); PostedSalesInv.SETFILTER(PostedSalesInv."No.","Document No."); PostedSalesForm.LOOKUPMODE(TRUE ); PostedSalesForm.SETTABLEVIEW(PostedSalesInv); PostedSalesForm.RUNMODAL; END END; CASE "Document Type" OF "Document Type"::Payment: BEGIN CLEAR(PostedPaymentForm); PostedPaymentInv.SETFILTER(PostedPaymentInv."No.","Document No."); PostedPaymentForm.LOOKUPMODE(TRUE ); PostedPaymentForm.SETTABLEVIEW(PostedPaymentInv); PostedPaymentForm.RUNMODAL; END END;
0 -
Hi all,
Sorry for the late reply. Yes, maybe 'one-to many relationship' is not appropriate definition.
The exact thing that I need to do is to combine records from Sales Header and Service Header, so, user can select Sales or Purchase Order in one place without choosing a document type at all. This field will be used as the information, and users do not want to search if they need to choose Service or Sales Order. That's the thing. Complex relationship depending of the other field value won't work for such case0 -
You can create a new table for that and add all sales headers and service headers with it's type. That way you can display this table to the user. When a record is selected you know where it comes from and open the right document.0
-
Thank you for the advice. I actually created new temporary table on the form and put there sales and service headers.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