Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable update of specific records

Status
Not open for further replies.

tomchesley

Technical User
Apr 16, 2006
17
0
0
US
I moved to a new position which has a Domino Server version 4.6. We have one database that we wish specific records not to be able to be updated unless at least 1 week has past since it was updated last.
There is a date field already in the database using @now
Soo,if that old date is less than 1 week ago we dont want to be able to edit that specific record. I'm kinda a newbee to Notes Programming so I'm stumped.
 
Okey, this should be relatively 'straightforward'...

Use either the event 'QueryModeChange' or 'PostModeChange' in the form and add something similar to this (The example here is from 'PostModeChange' and using formula language):

@If ( (@Date(@Today) - @Date(@Modified) / 84600) < 7; @Command([EditDocument]; 0); "")

In brief, it will check the date difference in days, and if less than 7, it will ALWAYS return 'read-only' mode of the document. Be a little careful and make sure it's properly tested before any activation...

All these formulas should be compatible in version 4.6 - I think...

Brgds,

TrooDOS
 
actually i had to do
@Abs(@Integer((@Today - @Modified) / (60 * 60 * 24)))
The 60 60 24 i did just to remind me how we got the 84600
when i did yours, i got an expected number error
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top