Options

Check the Company of a session

Hi
I know we have active sessions table in NAV. Is there any way to detect the company opened in that current session?

Basically adding a company name field on the active sessions page is the goal here.

Any pointers are appreciated :smile:

Thanks

Best Answer

Answers

  • Options
    jaspreet997jaspreet997 Member Posts: 3
    edited 2017-12-26
    Hi

    What you want is add company name in active session and in CU1's CompanyOpen function to update that field?

    This should work. Let me try this . Thanks for the idea!

    EDIT:
    Thanks this works. Basically added a new field 'Session company name' to active sessions table and wrote the below code in a OnAfterCompanyOpen subscriber function of CU1.

    [EventSubscriber] OnAfterCompanyOpen()
    WITH ActiveSessions DO BEGIN
    SETRANGE("Session ID",SESSIONID);
    IF FINDFIRST THEN
    "Session Company Name":=COMPANYNAME;
    ActiveSessions.MODIFY;
    END
Sign In or Register to comment.