Codeunit where we can lock users from changing WorkDate in NAV 2013

Hi Team,

I’m working on a project where our end customer doesn’t want just any user to be able to change Work Date in NAV 2013 when they’ll start production.

Previously, this code used be in CodeUnit 1 and we would do our customization.

Any idea where this code is present in NAV 2013?

Any help on this is highly appreciated.

Did you check Codeunit 40 - LogInManagement?

Hello Mohan,

Thank you very much for responding.

I have gone through a majority of the code units, and also went through the one you had suggested. This is only any good upon logging in, and doesn’t stop the user from changing the WORKDATE variable once they are logged in. The customer do not want his employees from changing the workdate and therefore changing posting dates etc.

As we are unable to access the NAV menu via the ribbons, we are also not able to go down this route either, just being able to disable changing of the work date using this method would have been a lot simpler.

I’ve been onto Microsoft with this same question, and apparently its not possible. I was hoping there would be a security setting that would stop a user from doing it. The only alternative is to find everyplace where it is used and put a condition around it, and default it to TODAY is the user is not able to change the date.

Have to say this is the avenue that we did not got down because of the problems it could cause.

Just look at the following post

http://www.mibuso.com/forum/viewtopic.php?t=51119

Here is a slightly different approach from a non-developer point of view,
you goal is to not let certain employees post transactions with a different date then “Today” correct.

So, you need to change the user setup allow to-from posting date to always be today. For this I would create a processing only report that updates the user setup table 91 to have the current date, run the report in the job scheduler or NAS and you are done. I would run this each evening so when the employee came in in the morning they would be ready to go. You filter it to run just on the restricted employees. You could add a field to the user setup table, a check box that you would check if they were restricted.

dt := TODAY + 1 // today plus 1 if you run it at night for the next day.

“User Setup” OnAfterGetRecord()
“Allow Posting From” := dt;
“Allow Posting To” := dt;
Modify;