If Number of days passed allow field to become editable

Dayzer
Member Posts: 12
Guys,
I am looking for a bit of help here. I want to make a field become editable after one week, everyweek.
I am new to this, so please go easy
Cheers
I am looking for a bit of help here. I want to make a field become editable after one week, everyweek.
I am new to this, so please go easy

Cheers
0
Comments
-
What kind of field? Does this record have a start date or posting date that can be used to calculate it's age?0
-
Savatage wrote:What kind of field? Does this record have a start date or posting date that can be used to calculate it's age?
It is a password field - What I need is every week the user can change there password. Once a change has been made it will then become uneditable till the next week
Thanks0 -
Is there any Date field existing on the table to calculate the week like "Last Modified Date".
and in which table?0 -
mohana_cse06 wrote:Is there any Date field existing on the table to calculate the week like "Last Modified Date".
and in which table?
Yes there is an existing field "Password Last Changed" which has the last time the password was changed.
Its on a Staff table.
Thanks0 -
Try this code in Form - OnAfterGetRecord() and Password Last Changed - OnAfterValidate() triggers..
CurrForm.Pwd.EDITABLE := (CALCDATE('<-1W>',"Password Last Changed") > WORKDATE);
0 -
mohana_cse06 wrote:Try this code in Form - OnAfterGetRecord() and Password Last Changed - OnAfterValidate() triggers..
CurrForm.Pwd.EDITABLE := (CALCDATE('<-1W>',"Password Last Changed") > WORKDATE);
Mmmh Seems like Im missing something0 -
so "password last changed" is a datetime field?
use this function
Date := DT2DATE(Datetime)
The datetime of which you want to return the date part.
http://msdn.microsoft.com/en-us/library/dd301385.aspx0 -
I guess Password Last Changed is datetime field not date type...
So tryCurrForm.Pwd.EDITABLE := (CALCDATE('<-1W>',DT2DATE("Password Last Changed")) > WORKDATE);
0 -
Guys, lets help Dayzer to do it properly.
The correct way to do this is to add code to the onvalidate trigger of the field and give an error. Not making the field non editable in the form. [-X
Can you imagine what you are teaching him? Instead of testing fields and checking as is standard in Navision, he is going to think its OK to write code that makes fields on forms editable to prevent users changing them.David Singleton0 -
DaysSinceLastChanged := TODAY-DT2DATE("Password Last Changed");
if DaysSinceLastChanged < 8 then begin
Error('Password Change Not Allowed');
end else begin
"Password Last Changed" := today;
modify;
end;
but what's forcing them to make the change?
What form/table is this "User Table"?, are you having it pop up each week by calcing the expiration date?
are they changing it every week? why?
If I had to change passwords every week I'd quickly forget which I have used last.0 -
Savatage wrote:DaysSinceLastChanged := TODAY-DT2DATE("Password Last Changed");
if DaysSinceLastChanged < 8 then begin
Error('Password Change Not Allowed');
end else begin
"Password Last Changed" := today;
modify;
end;
but what's forcing them to make the change?
What form/table is this "User Table"?, are you having it pop up each week by calcing the expiration date?
are they changing it every week? why?
If I had to change passwords every week I'd quickly forget which I have used last.
Well thanks everyone - Im going to do this right. So let me explain what I want to do
I have a Password field that I need to change every Month for each ID.
I need a msg to pop up every time it has to change.
It needs to be forced every month.
I am currently using a Staff table (This is not the main user table)
Thanks everyone :P0 -
Dayzer wrote:I have a Password field that I need to change every Month for each ID.
What do you mean by Password? If you mean the Navision log in password or something like that, then all this is managed in Active Directory and has no place what so ever in Navision.
If this is some kind of secondary password management process, then maybe you are doing the whole thing wrong and need to explain what you are doing and why.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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