Setup Window Login as Warehouse's Employee.

mel711mel711 Member Posts: 15
My company is using Windows Authentication to login Navision 4.0. Our windows login uses Group and Individual accounts.

I have a problem to setup Warehouse employees (Form 7328). When I lookup 'User Id' field, an "overflow" error is displayed because I have a Window's Group Id which exceeds the Navision's standard field length (Code 20). Now, I can modify the codeunit 418 "Login Management" 's LookupUserId(UserID) funtion to exclude all shortIDs which has length >20 or some other criteria.

1) The question is, if i modify this codeunit, will it affect anywhere else in the program? #-o
2) Or is there a better solution to this? :roll:



  • Options
    ArhontisArhontis Member Posts: 667

    The LookupUserID routine is called all over the application in the OnLookup Trigger of the filed "User ID" in various tables:

    I guess that filtering users with ID greater of 20 chars would only hide that users from that lookup form.

    So, I guess sommething like:
    LookupUserID(VAR UserID : Code[20]) : Boolean
    IF WindowsLogin.FIND('-') THEN
        s := ShortUserID(WindowsLogin.ID);//code added
        IF STRLEN(s)<=20 THEN BEGIN//code added
          TempLogin."User ID" := s;//s variable added instead of ShortUserID(WindowsLogin.ID);
          TempLogin."Windows Login" := TRUE;
          TempLogin."Windows Login ID" := WindowsLogin.ID;
          TempLogin.Name := WindowsLogin.Name;
        END;//code added
      UNTIL WindowsLogin.NEXT = 0;
    (where the s could be a text[1024] variable)
    whould work...

    (The code came from Nav 3.70.A.)
  • Options
    mel711mel711 Member Posts: 15
    Yah, i was going to do something like that. But my concern is whether is there any other place or module that will be affected? Eg: whether 'change log' or any registers will use this LookupUserID routine.

    Logically thinking, the system will store Individual Id (my individual id is only 6 characters long) instead of Group Id (which is used to ease role assignments, might have more than 20 characters) in tables where changing this routine seems harmless.
  • Options
    ArhontisArhontis Member Posts: 667

    I have checked the "where used" of the LookUpUserID function with the Developer's Toolkit and it is used only on the OnLookup routines of various tables.

    The change log gets the name of the user with the USERID function that returns only the name of the user not the full path.

    So I think that it is ok for you to make the change, or to be more accurate, ask your developer to make a "where used" on Navision 4.0 objects with the Developer's toolkit cause I haven't imported the Nav 4.0 Objects into Developer's Toolkit yet.
  • Options
    mel711mel711 Member Posts: 15
    Hi Arhontis,

    Thanks for your answer and quick reply. Making the changes seems harmless since its only for lookups. So, I will take your advice :lol:

    However, in your given code, should move this line up because WindowsLogin.ID is a FlowField:
    - WindowsLogin.CALCFIELDS(ID,Name);
      s := ShortUserID(WindowsLogin.ID);

    Thanks ! :mrgreen:
  • Options
    ArhontisArhontis Member Posts: 667

    You are right... You should move the CALCFIELDS up.

    Sorry for the little mistake...

    I have also checked the Navision 4.0 Objects (imported them into the Developer's toolkit) and that function is only used in lookups...
  • Options
    mel711mel711 Member Posts: 15
    Thanks a lot there! U are a great help \:D/
Sign In or Register to comment.