Hi,
In the Employee table i have created the field UserID and linked with UserSetup table. In Employee form i included the field Userid where for each employee one userid is assigned. If userid is not mapped in the employee card then it should not allow me to enter into the company.
As well when the status of the Employee is Inactive, then it should not allow me to enter into the company.
This needs to work for both in Windows login as well as in Database Login.
As per the suggestions , I have placed the coding in 1 codeunit in LogInstart trigger. the following code is as follows
recemployee.RESET;
recemployee.SETRANGE("Users IDD",USERID);
recemployee.setfilter(recemployee.Status,
'%1|%',recemployee.Status::Inactive,recemployee.Status::Terminated);
IF recemployee.FINDFIRST THEN
ERROR('Employee %1 does not exist',recemployee."Users IDD");
Even though after placing the code, it allow the user to enter into the company without exit.
Waiting for your valuable suggestions.
Jai
0
Comments
Is the following a typo?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.