Error Command is allowing to open company????

kish2007kish2007 Member Posts: 64
Hi,
In Codeunit1 -> I put error message in Company open function. but it is showing the error message but it is opened the company. My scenario is If the condition is true it will display the error message and the company will not open.

How can i do that?


Thanks & Regards,
kishore...

Comments

  • kinekine Member Posts: 12,562
    You can send the File-Database-Close hotkeys through sendkeys functionality. The error will not stop opening the company...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kish2007kish2007 Member Posts: 64
    Hi Kine,
    I tried by using Send keys but it was not stopped.The Company was opened.




    Regards,
    Kishore...
  • kinekine Member Posts: 12,562
    Question is, if you have send correct keystrokes and you cannot open the error or dialog, else the sent keys will end in this dialog...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    The correct answer is to use Navision's built in company level security.
    David Singleton
  • kinekine Member Posts: 12,562
    The correct answer is to use Navision's built in company level security.

    There are cases when this is not enough.... e.g. limiting users to login only once...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    The correct answer is to use Navision's built in company level security.

    There are cases when this is not enough.... e.g. limiting users to login only once...

    Correct, and for that we have this other very rarely used feature of Navision called "User Training" :mrgreen:
    David Singleton
  • kinekine Member Posts: 12,562
    But still, sometime you need to force users to do something... :-) Not everyone will do what you learn them, and sometime you have technical limits, e.g. when using one DB for more companies (one license), each of them have limited session count and you need to force them to use only assigned count of sessions per company... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    ...e.g. when using one DB for more companies (one license), each of them have limited session count and you need to force them to use only assigned count of sessions per company... ;-)

    I am not sure I understand the issue. Lets say the company has 100 people that use Navision and have purchased 65 concurrent licenses (a fairly typical ratio). If they find that 75 users are trying to log in concurrently then they go an buy 10 more licenses. I can't see the issue here?
    David Singleton
  • kinekine Member Posts: 12,562
    We are going off-topic but...

    Example

    Company A - owns Company B and C.

    Company A have NAV license for 80 users.

    Now you want to make the system in a way, that each time, there is max 40 users in company B, 40 users in company C and there is each time available 2 sessions for users from company A (it means that B + C must be <78). You cannot do that only with training, the license is shared with more companies and each have some "share" on the sessions...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • AsallaiAsallai Member Posts: 141
    kish2007 wrote:
    Hi,
    In Codeunit1 -> I put error message in Company open function. but it is showing the error message but it is opened the company. My scenario is If the condition is true it will display the error message and the company will not open.

    How can i do that?


    Thanks & Regards,
    kishore...

    Hi kishore,
    Our clients I had to do similar things, if their login id was expired. I made a modification in cu1 at CompanyOpen triggers, when a User is open an NAV, every time I close the company first! (it is necessary, because every user's have own zup file what is contains the latest parameters of a client's NAV). So, after when closed the company you can run your own process what is check the capacity of your licence. You can use for this the Session system table, where are the values of the Logins (including the actual "My Session" too, the owner of the NAV client user...).
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    We are going off-topic but...

    Example

    Company A - owns Company B and C.

    Company A have NAV license for 80 users.

    Now you want to make the system in a way, that each time, there is max 40 users in company B, 40 users in company C and there is each time available 2 sessions for users from company A (it means that B + C must be <78). You cannot do that only with training, the license is shared with more companies and each have some "share" on the sessions...

    So you purchased 80 licenses, but you need 82 logins? Seems the simple solution is to purchase 2 more User Sessions.

    It looks to me that this is all because the client does not have enough licenses. :-k

    Anyway although I never like replacing licensing and training issue with code, the actual solution to this would be to add a field in the COmpany table "Suggested Max Users"::Integer.

    At log in, look at how many users are logged in to that company, and if higher than that number, open a dialog box that says : "There are too many users logged in to this company, please log out".
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Oh and don't forget that any modifications written to NAV specifically for the purpose of circumventing licensing requirements its clearly illegal.

    Looking again at the post above, it looks like the client should have purchased the per database licensing granule, but didn't, so the situation above is in contravention of the End User License.

    I know that often developers are just thrown in there and told "do it" but sometimes we have to weight up our job requirements to our own moral obligations and do things the right way.

    Clients that can not afford to use Navision need to seriously consider if its the right product for them. I will be the first to agree that some of Navision's licensing policies are draconian, and others are just down right pathetically stupid, but we don't set the rules, we just have to follow them

    If your client is trying now to save money on one granule, next will be a requirement to write a Share Point interface for 50 users using one User slot so they can save on 49 licenses. And I think we are all wise enough to know that that is happening out there now.

    I must say that the person in Microsoft that is now trying to work out the future of Navision licensing has a huge job ahead, and no matter what they decide, in this democracy of ours, at least 50% of Navision clients are going to be unhappy.

    But in the meantime lets do our bit and not put code out there that in our hearts we are quite certain is going to be used illegally.
    David Singleton
Sign In or Register to comment.