Work date For Several Users

jaclynjaclyn Member Posts: 56
How To Restrict Work date For Several Users?

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    HI

    There is no way to restrict work date as far as I am aware.

    You can restricted allowed Posting Date instead: system wide by editing Allow Posting From/To in General Ledger Setup, or for uses indivisually in User Setup.

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • jaclynjaclyn Member Posts: 56
    Thanks for your suggestion

    Please check i think this syntax useful for me

    Create a New single instance code-unit. This code-unit you have to launch in Code-unit 1 Function LogInStart(). Globals :

    recUserSetup : Record : "User Setup"
    autTimer : Automation : 'Navision Timer 1.0'.Timer (property WithEvents=Yes)

    OnRun() of your singleinstance codeunit:

    IF ISCLEAR(autTimer) THEN BEGIN
    CREATE(autTimer);
    autTimer.Interval(3 * 1000); // test each 3 seconds
    autTimer.Enabled(TRUE)
    END;
    CLEAR(recUserSetup);
    IF recUserSetup.get(USERID) THEN ;

    On Trigger
    autTimer::Timer(Milliseconds : Integer)

    IF TODAY <> WORKDATE THEN
    IF NOT recUserSetup."User May Change WORKDATE" THEN BEGIN WORKDATE := TODAY;
    MESSAGE('You may not change the WORKDATE. WORKDATE has been resetted');
    END;
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Hi,

    Automation NTimer shiped with Classic NAV does not work in RTC. You would need to use PingPong or some other .NET based timers but as far as I know they need to be as visible parts on a Page to get them working.

    Secondly even if you get PingPong or other timer working NAV executes code serially. It means that whatever process is running it will finish uninterrupted, and the timer event will be fired after the controll is returned to the user. Which in turn means that someone can be quick enough to change the WORKDATE, and fire some proces using the WORKDATE variable, and this new WORKDATE will be effective for as long as the process is running.

    Restrincting users to change WORKDATE seems to me not very good idea. Why do you need to restrict changing WORKDATE? In most cases it serves only as the default date proposed by NAV on newly created documents and users can change document dates afterwards anyway. If you already modified the system to not allow users changing the date why don't you just take it a bit further and change the code to use TODAY rather than WORKDATE?

    Generally I wouldn't recommend any sort of restrictions like that, and rather try to train my users, explain and highlight the importance of using today's date, plus apply change log to control what they are entering in few critical places. The effect in longer therm is much better imho - you will have users aware of process requirements, importance, rather than having people typing in what system allows, with no considreation of what they are really doing.

    My 0.02£

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • jaclynjaclyn Member Posts: 56
    Thanks Slawek,
    this is very help reply for me if any other issue we are facing So I will connect with you

    Thanks Again
Sign In or Register to comment.