Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4387 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Since FMP does not automatically update the year portion of a date, IE; enter 2/26 and 2/26/2012 comes up even though it has already past.

 

I would like to place a trigger in the cell that would automatically enter 2013 the year if that date in 2012 has already past. I'm working in 2013 and I am constantly going back and changing dates.

 

Thanks...

Posted
I would use a script attached to a button.
 
Date (
Month ( Get ( CurrentDate ) ) ;
Day ( Get ( CurrentDate ) ) ;
Year ( Get ( CurrentDate ) ) + 1
)
Posted

Hi,

 

I think we would need to preserve the entered month and day.  I would also ask what if you entered a date more than a year old accidentally (or on purpose)?   It might seem that auto-enter (replace) would be the way to go but I would worry that, during a migration where 'perform auto-enter' were checked, it could change the date later OR if you actually DID need to backdate so as Lee suggests, script is the way to go.

OnObjectExit trigger:

If [ yourDate < Get ( CurrentDate ) and yourDate ]

Set Field [ yourDate ;

 

Let ( [d = Get ( CurrentDate ) ;this = Date ( Month ( yourDate ) ; Day ( yourDate ) ; Year ( d ) ) ] ;Date ( Month ( this ) ; Day ( this ) ; Year ( this ) + ( this < d ) ))
End If

If you ever DO want to enter an older date, you will not be able to do so on a layout with this script trigger attached.  :^)

 

EDITED ... I have changed the calculation.  I realized there was possibility of it breaking under certain conditions with older years.  This should work in all cases.  :^)

This topic is 4387 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.