Select non primary key column when using table relation

GavNav
Member Posts: 10
Hi all,
I have to redesign form 42 (Sales Order) for a long established customer using v5.01 SQL. One of the mods involves a bespoke field called "Order Given By". Currently it links to the Salesperson/Purchaser table and the user selects the appropriate record. Naturally this works but the problem is that it populates the cell with the Primary Key value (Code). The user would prefer if the Name in the record was displayed. Has anyone got any idea how to do this. The is a look up table relation, user clicks their chosen record and the textbox displays the Name field (non pk). Before it is suggested I don't want to add Name to my PK because it may mess up a lot of GET statements which I have. Any advice welcome.
Thanks
Gav
I have to redesign form 42 (Sales Order) for a long established customer using v5.01 SQL. One of the mods involves a bespoke field called "Order Given By". Currently it links to the Salesperson/Purchaser table and the user selects the appropriate record. Naturally this works but the problem is that it populates the cell with the Primary Key value (Code). The user would prefer if the Name in the record was displayed. Has anyone got any idea how to do this. The is a look up table relation, user clicks their chosen record and the textbox displays the Name field (non pk). Before it is suggested I don't want to add Name to my PK because it may mess up a lot of GET statements which I have. Any advice welcome.
Thanks
Gav
0
Comments
-
I think there are two solution:
- Remove table relation and customize OnValidate/OnLookup table trigger to rescue the name and check that is matching with the name from Salesperson/Purchaser table.
- Keep the current logic and adding a new field on Sales Order table as a FlowField of type lookup to pointed to field Name (if users accept to chose the salep. code and see the name in an adjacent field).* Daniele Rebussi * | * Rebu NAV Diary *0 -
Thanks for your reply Daniele. In the end what I did was created a new textbox on the form and set that to a variable "SalespersonName". In the OnValidate of my bespoke table relation field "Order Given By" I added some code to GET the record from the Salesperson/Purchaser table and set my new textbox equal to Name from the retrieved record. It works perfectly. Thank you for your suggestions.
Gav0
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