How to restrict WORKDATE for several users
Madhan
Member Posts: 96
hi all,
Great day to every one.
I like to know whether it is possible to restrict WORKDATE for a particular user. can any one help me how to do this?
For Example
I am having Five users,
In that only two users will be able to change the WORKDATE and the remaining three can not.
Great day to every one.
I like to know whether it is possible to restrict WORKDATE for a particular user. can any one help me how to do this?
For Example
I am having Five users,
In that only two users will be able to change the WORKDATE and the remaining three can not.
0
Comments
-
Not so easy, but I have an idea, but I didn't test it:
Create a singleinstance codeunit. This codeunit you have to launch in Codeunit 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 ;
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;
PS : you need to create field recUserSetup."User May Change WORKDATE".Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
There are some topics about this on www.mbsonline.org
For example:
http://www.mbsonline.org/forum/topic.as ... kdate,user0 -
Thanx a lot
I will work on it and update you.0 -
Hi
For Another developer with same problem.
http://www.mibuso.com/forum/viewtopic.php?p=52893#52893
==================================
Richard0 -
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;0 -
dear kriki,
Thanks for providing the its working fine.
Regards,
AniruddhaThanks & Regards,
Aniruddha0 -
IS THERE A WAY TO GET THE SERVER DATE AND PUT THAT DATE IN ALL CLIENTS?Regards,
Rakesh Raul
Consultant (Sr.)
Cognatio Systems LLC
T: +971 4 359 0202 EXT : 404
F: +971 4 359 0205
M: +971 52 908 9987
www.cognatiosystems.com
Skype ID : RaulRakesh0 -
I got solution for SQL DB that i have created one Date field in Company Info Table and written stored procedure in SQL to populate date in to Date field. Executing procedure by using JOBS. Now as suggested by kriki i have written code which is working fine.
In case of FDB I am using Jog Queue, but I am facing some problem with Job QUEUE.Regards,
Rakesh Raul
Consultant (Sr.)
Cognatio Systems LLC
T: +971 4 359 0202 EXT : 404
F: +971 4 359 0205
M: +971 52 908 9987
www.cognatiosystems.com
Skype ID : RaulRakesh0 -
-
Dear Kriki
I had gone through you Code, but I am not able to configure 2nd line of below code ! Would you help me out to do this.
recUserSetup Record - I had define the field in User Setup table as well as Singleinstance codeunit as global variable.
autTimer - where I need to configure autTimer
Code: Select all
recUserSetup Record "User Setup"
autTimer Automation 'Navision Timer 1.0'.Timer (property WithEvents=Yes)
regds
Rupesh VermaRupesh Verma
Floor & Furnishing (I) Pvt. Ltd.0 -
In the global variables of the codeunit, you need to create a variable of type automation and select the Navision timer (you need to have NAV installed in a correct way or otherwise you need to registrate the dll yourself in Windows).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Kriki
Thanks for giving us the solutions, you solutions is working fine.
regds
Rupesh Verma
Kortek ElectronicsRupesh Verma
Floor & Furnishing (I) Pvt. Ltd.0 -
Kriki provided good solution. But still i would go ahead with themave solution with minor modification. Instead of creating a report and running it through NAS , write the same code to update "Allow posting from" and "allow posting to" as today through Application management code unit on LogInStart function. That will make life simple.
Regards,
Faisal Bukhari0 -
Dear Kriki
Thanks for giving me the solutions to restrict/allowed the Users to change the Work Date.
Rupesh VermaRupesh Verma
Floor & Furnishing (I) Pvt. Ltd.0 -
kriki wrote:In the global variables of the codeunit, you need to create a variable of type automation and select the Navision timer (you need to have NAV installed in a correct way or otherwise you need to registrate the dll yourself in Windows).
Dear Kriki
Thanks for giving me the solutions to restrict/allowed the Users to change the Work Date.
_________________
Rupesh Verma
Kortek Electronics (I) Pvt. Ltd.Rupesh Verma
Floor & Furnishing (I) Pvt. Ltd.0 -
Hi all,
I found this thread interesting.
How can we do that in Navision 2013 ?
I try to implement this solution in Nav 2013, but soon find out that Navision Timer 1.0 no longer supported.
Any updates ?
Thanks0 -
Look at the codeuint 1 and check a workdate on OnGlobalModify|OnGlobalModify|OnGlobalInsert functions.Looking for part-time work.
Nav, T-SQL.0 -
Hi rmv_RU,
I can't find anything related to OnGlobalModify|OnGlobalModify|OnGlobalInsert functions in codeunit 1?
any clue ?
thanks0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
