Company per User

bekiobekio Member Posts: 204
Hello,

How can i know wich user is logged in in wich company.
Does NAV has any tabel that we can know wich user is log on in wich company.


Thanks for your help!

Answers

  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]

    No, it doesn't.

    But you can create a table in which you save the info and fill it up in codeunit 1 function "CompanyOpen()".

    But why do you want to know this?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • matttraxmatttrax Member Posts: 2,309
    Mostly thinking out loud here. If you are on SQL, and not sharing tables between companies, you could do some sort of trace on the login. The table names are [Company$Table] so you could take the prefix of the last table they touched and know the company name.
  • bekiobekio Member Posts: 204
    I have a problem, i have purchased a Licence for 20 users.
    I have a customer that has more than one Company, cutomers has more than 40 users for NAV. Not all the users work at the same time.
    I have three Company with 25 users, company xxx with 5 users, company yyy with 15 users and company zzz with 5 users.
    Lets say that company yyy want's just 10 users to be active at the same time, users of its ow company, so that 10 other users to be from other company.
    I want to contoll this if is any possibility.

    Do i have any possibility to do this!

    Thanks for your replay!
  • matttraxmatttrax Member Posts: 2,309
    Not out of the box. Sessions are granted to a database, not a company. You can do it with customization, though. As Kriki suggested, modify Codeunit 1 to track logins to a specific company. A word of caution, though, test well. Codeunit 1 is the "brain", you don't want to mess it up. You can easily make it so you can't even log into the database. So be sure and have a current backup.
  • navuser1navuser1 Member Posts: 1,329
    bekio wrote:
    Hello,

    How can i know wich user is logged in in wich company.
    Does NAV has any tabel that we can know wich user is log on in wich company.


    Thanks for your help!

    Hi Bekio.

    I'm navuser1, but my login IDs (user name) are navuser1_CMF and navuser1_CIPL in a DB.

    navuser1_CMF has the permission to work on the CMF company and navuser1_CIPL has the permission to work on the CIPL Company in same Datanase.


    I think this will help you.
    Now or Never
  • bekiobekio Member Posts: 204
    Hello Kriki,

    I have tried to do that in codeunit 1 Application Management, i have created a table so every time that i login, i save login and company name to that table, when i close NAV i delete that user.
    This is my problem:
    I have a licence that has just 20 session, and two company, one X that has 10 users and another Y that has 20 users.
    If users from companu X are not loged in, users from company Y can all log in to their company.
    I want that just 10 users from company Y to be active at the same time.

    I have done this, and i have put an Error to Codeunit 1, but it don't consider that Error. Error is displayed but nothing happens and company Y,user 11 loged in succesfully. It seems that Error dose not work at that point.

    I can do it, using SLEEP keyword, or killing the NAV(finsql.exe) process, but i don't like this solution. [-X

    Can you help, what command should i use to not open that company.
  • matttraxmatttrax Member Posts: 2,309
  • bekiobekio Member Posts: 204
    No it does not work.

    I have tried also with Exit.
  • matttraxmatttrax Member Posts: 2,309
    I know I have seen other posts with people trying to modify the LoginStart function in Codeunit 1 to stop execution. I'm not sure if they ever found a solution.

    Honestly, you are trying to do something that the NAV Application and Licensing are not designed to do. If they needed this type of control they should have bought two licenses.
  • krikikriki Member, Moderator Posts: 9,110
    I think it would be better to use the sessionkiller: http://www.mibuso.com/howtoinfo.asp?FileID=18.
    This way everyone can log in when needed (and not limited to N sessions in 1 company).
    You can set it up that if you reach the limit of sessions, NAV (the NAS) starts killing some older sessions.
    I have used it on some customers with very gratifying results.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.