Lookup User Table in the report request page.

basic0220basic0220 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)

hxwzji8bel0v.png

But Whenever I try to select the User
77ibaynu6w47.png


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

Am I missing something out here?


thank you for answering.







Best Answer

Answers

  • basic0220basic0220 Member Posts: 43
    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.
  • ajmosca25ajmosca25 Member Posts: 1
    edited 2018-09-05
    basic0220 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.
Sign In or Register to comment.