AnsweredAssumed Answered

Date Calculation for Locking Records

Question asked by BERGSTEN on Feb 1, 2012
Latest reply on Feb 2, 2012 by philmodjunk

Title

Date Calculation for Locking Records

Post

I'm trying to tell my schedule table that it should lock records if a year prior to the current one is present in the date field.

I'm using the method described here: http://fmforums.com/forum/topic/67811-locking-records-against-changes/ (TL;DR for the article: Using a field "Lock" on the table, you can use priviledge sets to lock the field based on wether it shows a 1 or a 0. If it displays 0, the record locks)

The problem is, I have a lot of records and would like to automate the process. I'm trying to make the "Lock" field a calculation with a number 0 or 1 result. 

What hasn't worked:

If (Year (Get(CurrentYear)) -1; 0) ...and a number of variations with paranthesis in different places. I've also tried this with If (Year (2012) -1; 0) just to try and get anything to work

It seems that however I edit this, I get either a 0 or a 1 on every record and there's no distinction between 2011 and 2012. All 2012 should be showing 1 and 2011 should be showing 0. Ideally, this calculation would lock records as the year changes. (In 2013, it will lock 2012's days).

Any ideas? This is driving me crazy!

Outcomes