Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Year(Get(CurrentDate) ?

Featured Replies

We have a special needs class that has special services provided. These services are povided on a "Service Date".

I need to set another field based on the year of the Service Date (which is displayed as a normal date 7/1/2012),

I have tried

If [service Date= Year(Get(CurrentDate)]

Set Field [unit Count; Service Units]

but nothing happens. I thought this would check the Service Date field against the current Date/Year and if the year was part of the Service Date then the field would be set.

But it does not work.

Can someone assist?

Thank you,

Michelle

The expression in If [] compares a date ( Service Date) with a number ( Year ( Get ( CurrentDate ) ).

Instead, compare two numbers - the year of Service Date and the current year:

If [ Year ( Service Date ) = Year ( Get ( CurrentDate ) ) ]

If Unit Count is a calculation field ( or a number field with an auto-entered calculation), the correct syntax for the calculation is

If(Year(Service Date) = Year(get(CurrentDate)); ServiceUnits)

If this is a part of a script, the correct syntax is

If[Year(Service Date) = Year(get(CurrentDate))]

Set Field [unit Count; Service Units]

End if

  • Author

Thank you both very much, It is now very clear :)

I finally gave up last night around midnight. Thanks again for all the help.

I am off to make a dontation to the FMForums Tip Jar!

You posted this in the calculation section, yet you are using a script syntax. Be aware of the difference. The current year is something that changes every January 1st. A calculation field - provided it's unstored - will evaluate anew on every screen refresh. Setting the field by script will store the result and leave it as is until you run the script again.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.