Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

NAV 2016 User permission for changing the WORKDATE

$
0
0
Hi,

at first:
I'm new in the forum, so I apologize for eventually posting my topic in the wrong forum section. Also I apologize for any grammar mistakes as I am not a native speaker.

I'd like to only let permitted Users change the work date. I found several topics in the forum about this but unfortunately there was no solutionn for me.
According to my supervisor I must not use any timer-based solutions.

What are my options? There doesn't seem to be any specific trigger being executed after changing the work date...
I tried out several triggers in Codeunit 1 (OnDatabaseModify/OnDatabaseDelete/... , MakeDateText/MakeTimeText/...) but it didn't have any effect.

This is my code I want to run (it's in a separate Codeunit):
WorkDatePermissionCheck()
IF NOT UserHasPermission THEN BEGIN
  IF WORKDATE <> TODAY THEN BEGIN
    WORKDATE := TODAY;
    MESSAGE(Error001,USERID); // ERROR(Error001,USERID);
  END;
END;

UserHasPermission() : Boolean
IF NOT UserSetup.GET(USERID) THEN
  EXIT(FALSE);
EXIT(UserSetup."Allow Changing Workdate");

Thanks in advance
Wittgenstein

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>