Lookup User Table in the report request page.

basic0220
Member Posts: 43
Hi All,
I'm doing a modification in my customized report wherein
the client wants their signatory to be looked up in the User Table.
I made the initial process for this type of modification.
I didn't write any code, or anything I just set the property of the
Signatory field's TableRelation to the User Table. (See Screenshot Below)

But Whenever I try to select the User

and Press "Enter" or "Tab" Either way.
I'm getting this error.

Am I missing something out here?
thank you for answering.
I'm doing a modification in my customized report wherein
the client wants their signatory to be looked up in the User Table.
I made the initial process for this type of modification.
I didn't write any code, or anything I just set the property of the
Signatory field's TableRelation to the User Table. (See Screenshot Below)

But Whenever I try to select the User

and Press "Enter" or "Tab" Either way.
I'm getting this error.

Am I missing something out here?
thank you for answering.
0
Best Answer
-
Relation can only be used for fields which are part of primary keys. In all other cases you need to code the lookup function.
The "Full Name" field is not a part of primpary key on the User table, hence the error (which tells you exactly that).
Change relation to use User Setup table, and add some code to retrieve selected used full name from the User table, and show the full user name in a field next to User Code (you will need to show User Code field to use automatic relation-based lookup functionality
Or write your bespoke lookup function - but I guess event then you shoud also show the user code - in case you have two "John Smith" in some future. Have a look into codeunit 418 User Management, there are a few "lookup user" functions there, perhaps you could use one of those.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
Relation can only be used for fields which are part of primary keys. In all other cases you need to code the lookup function.
The "Full Name" field is not a part of primpary key on the User table, hence the error (which tells you exactly that).
Change relation to use User Setup table, and add some code to retrieve selected used full name from the User table, and show the full user name in a field next to User Code (you will need to show User Code field to use automatic relation-based lookup functionality
Or write your bespoke lookup function - but I guess event then you shoud also show the user code - in case you have two "John Smith" in some future. Have a look into codeunit 418 User Management, there are a few "lookup user" functions there, perhaps you could use one of those.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
Slawek_Guzek wrote: »Relation can only be used for fields which are part of primary keys. In all other cases you need to code the lookup function.
The "Full Name" field is not a part of primpary key on the User table, hence the error (which tells you exactly that).
Change relation to use User Setup table, and add some code to retrieve selected used full name from the User table, and show the full user name in a field next to User Code (you will need to show User Code field to use automatic relation-based lookup functionality
Or write your bespoke lookup function - but I guess event then you shoud also show the user code - in case you have two "John Smith" in some future. Have a look into codeunit 418 User Management, there are a few "lookup user" functions there, perhaps you could use one of those.
Hi Thank you for the information. I formulated a work around to my problem
Thank you very much for the help.0 -
Slawek_Guzek wrote: »Relation can only be used for fields which are part of primary keys. In all other cases you need to code the lookup function.
The "Full Name" field is not a part of primpary key on the User table, hence the error (which tells you exactly that).
Change relation to use User Setup table, and add some code to retrieve selected used full name from the User table, and show the full user name in a field next to User Code (you will need to show User Code field to use automatic relation-based lookup functionality
Or write your bespoke lookup function - but I guess event then you shoud also show the user code - in case you have two "John Smith" in some future. Have a look into codeunit 418 User Management, there are a few "lookup user" functions there, perhaps you could use one of those.
Hi Thank you for the information. I formulated a work around to my problem
Thank you very much for the help.
edited:
@Slawek_Guzek , I follow your suggestion. Thank you.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