mibuso.com

Microsoft Business Solutions online community
It is currently Sat Dec 27, 2014 4:06 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to restrict WORKDATE for several users
PostPosted: Thu Mar 09, 2006 8:55 am 
Offline

Joined: Thu Jun 16, 2005 7:46 am
Posts: 62
Location: chenna
Country: India (in)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 9:36 am 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 9:13 am
Posts: 7705
Location: Milan
Country: Italy (it)
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 :
Code: Select all
recUserSetup Record "User Setup"
autTimer  Automation  'Navision Timer 1.0'.Timer (property WithEvents=Yes)

OnRun() of your singleinstance codeunit:
Code: Select all
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)
Code: Select all
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
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2015 - 19 & 20 November 2015 (!) ««« Visit the conference website: http://www.navtechdays.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 10:05 am 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Tue Jul 19, 2005 3:49 pm
Posts: 4188
Location: Olst
Country: Netherlands (nl)
There are some topics about this on www.mbsonline.org

For example:

http://www.mbsonline.org/forum/topic.as ... kdate,user

_________________
Mark Brummel | Freelance Dynamics NAV (Navision) Specialist

Read my new book: Microsoft Dynamics NAV 2013 Application Design

MY BLOG : http://markbrummel.wordpress.com


Top
 Profile E-mail WWW  
 
 Post subject: hi
PostPosted: Thu Mar 09, 2006 10:41 am 
Offline

Joined: Thu Jun 16, 2005 7:46 am
Posts: 62
Location: chenna
Country: India (in)
Thanx a lot

I will work on it and update you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 7:51 am 
Offline

Joined: Fri Jun 30, 2006 8:34 am
Posts: 10
Location: seoul
Country: Korea, Republic of (kr)
Hi

For Another developer with same problem.


http://www.mibuso.com/forum/viewtopic.php?p=52893#52893


==================================
Richard


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 4:15 pm 
Offline

Joined: Mon Oct 29, 2001 7:01 am
Posts: 1030
Location: Livermore, California
Country: United States (us)
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;


Top
 Profile E-mail  
 
 Post subject: Work date
PostPosted: Mon Sep 11, 2006 9:30 am 
Offline

Joined: Fri Feb 25, 2005 10:17 am
Posts: 41
Location: Kolkata
Country: India (in)
dear kriki,

Thanks for providing the its working fine.

Regards,
Aniruddha


Top
 Profile  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Fri Feb 06, 2009 7:05 am 
Offline

Joined: Fri Feb 06, 2009 6:53 am
Posts: 4
Location: Dubai
Country: United Arab Emirates (ae)
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 : RaulRakesh


Top
 Profile E-mail  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Tue Mar 31, 2009 11:39 am 
Offline

Joined: Fri Feb 06, 2009 6:53 am
Posts: 4
Location: Dubai
Country: United Arab Emirates (ae)
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 : RaulRakesh


Top
 Profile E-mail  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Tue Mar 31, 2009 6:53 pm 
Offline

Joined: Mon Mar 08, 2004 1:42 pm
Posts: 3255
Location: Hannover
Country: Germany (de)
viewtopic.php?f=23&t=24501

_________________
Do you make it right, it works too!


Top
 Profile  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Sat May 12, 2012 11:29 am 
Offline

Joined: Thu Sep 11, 2008 3:12 pm
Posts: 17
Location: Delhi & NCR
Country: India (in)
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 Verma

_________________
Rupesh Verma
Floor & Furnishing (I) Pvt. Ltd.


Top
 Profile  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Mon May 14, 2012 8:28 am 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 9:13 am
Posts: 7705
Location: Milan
Country: Italy (it)
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
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2015 - 19 & 20 November 2015 (!) ««« Visit the conference website: http://www.navtechdays.com


Top
 Profile  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Thu May 17, 2012 8:52 am 
Offline

Joined: Thu Sep 11, 2008 3:12 pm
Posts: 17
Location: Delhi & NCR
Country: India (in)
Hi Kriki

Thanks for giving us the solutions, you solutions is working fine.
regds
Rupesh Verma
Kortek Electronics

_________________
Rupesh Verma
Floor & Furnishing (I) Pvt. Ltd.


Top
 Profile  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Thu May 17, 2012 11:47 am 
Offline

Joined: Fri Sep 25, 2009 5:33 am
Posts: 49
Location: Mumbai, India
Country: India (in)
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 Bukhari


Top
 Profile E-mail  
 
 Post subject: Re: How to restrict WORKDATE for several users
PostPosted: Sat Feb 16, 2013 11:30 am 
Offline

Joined: Thu Sep 11, 2008 3:12 pm
Posts: 17
Location: Delhi & NCR
Country: India (in)
Dear Kriki

Thanks for giving me the solutions to restrict/allowed the Users to change the Work Date.

Rupesh Verma

_________________
Rupesh Verma
Floor & Furnishing (I) Pvt. Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: