User ID in User Setup

DenSterDenSter Member Posts: 8,305
The "User Setup" table (number 91) has a field called "User ID". The lookup code runs through codeunit 418, which gives you database logins as well as windows logins. When you run the form (119), the code runs, and it correctly populates the field when you select a user. So far so good.

Here's the weird part.... when you add the User Setup table as a dataitem to a report, and you want to set a filter on user ID, it does not populate the field when you select a user. It gets even weirder.... when you run the table directly from the object designer, it also does not populate the field. It runs through the same code, but it just will not populate the field when you select something form the list...

Has anyone run across this? Any ideas on how to make it properly populate that field? This happens in standard 2009SP1, 2009, 50SP1 and even 40SP3. I am stumped, I just can't figure out why it's not working.

Comments

  • kapamaroukapamarou Member Posts: 1,152
    I think it's standard behavior when editing on the table level. It only populates through the form. Add a field like CustomerCode and use code with lookup form to populate the field. It won't work. It populates the field only if the lookup is done by the Table Relationship and not the code on the trigger.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    It works fine for me.

    User ID is the primary key, so that must be populated.
    David Singleton
  • DenSterDenSter Member Posts: 8,305
    so when you run the table directly it works as well? What about adding User Setup as a dataitem on a report. When you look up the user ID for the filter, does that populate it too?
  • ayhan06ayhan06 Member Posts: 210
    this is a standard behaviour. onlookup triggers work only for forms.I came across this before.

    If you run table directly from object designer, every assignment which has been done in onlookup trigger is rollbacked when exiting onlookup trigger.

    If you run table within a form, everything is normal.
  • kapamaroukapamarou Member Posts: 1,152
    It works fine for me.

    Really? :-k

    For me it works as DenSter described (just tried in 4.00 SP3 build 23305)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    DenSter wrote:
    it does not populate the field when you select a user.

    Ah you mean't the look up doesn't work, I thought you mean the field was not populating.

    Yes this is normal behavior Navision has always worked like this.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Generally when a client uses mixed Windows and Database log ins on SQL I have found that if they want to do reporting like this you have to code some work arounds.
    David Singleton
  • DenSterDenSter Member Posts: 8,305
    Ah you mean't the look up doesn't work, I thought you mean the field was not populating.
    Yes this is normal behavior Navision has always worked like this.
    The lookup DOES work. When you hit the lookup button, it displays the correct list of things to choose from. It runs through codeunit 418 to build the temp list of users from windows logins and database logins.

    The problem comes in when you select one of them. When you select a record from that list, and you click the OK button, it populate the field only when you do it from a form, but not from the table itself or when filtering on a dataitem.

    The lookup works, populating the field when selecting a record does not. I think we're talking about the same thing, but you are calling it something else.
  • vijay_gvijay_g Member Posts: 884
    ayhan06 wrote:
    this is a standard behaviour. onlookup triggers work only for forms.I came across this before.

    If you run table directly from object designer, every assignment which has been done in onlookup trigger is rollbacked when exiting onlookup trigger.

    If you run table within a form, everything is normal.

    Thanks a lot.....
    yes i have faced this problem also and put it on mibuso earlier but nobody has mind. :oops: :oops:

    even what was the reaction on it............ may be i was not able to understand it properly..
    http://www.mibuso.com/forum/viewtopic.php?f=23&t=42075

    Now the problem is when i want to lookup "USER ID" field of User Setup table through TableRelation property (that table(set in table relation) has LookupFormID ) then i am not able to do. i have remove code from onlookup trigger.
    what can be mistake?
Sign In or Register to comment.