Jump 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.

Featured Replies

Okay, I've done the searches... sifted through the results, and still have not found my answer to this question.

If this question has already been asked, please forgive me, but I couldn't find it.

I am looking for a way to have a field contain a value updated by a script.

One field named "month" which will contain the current Month

And one field named "year" which will contain the current Year

I would like those values to update themselves. Via a script, if possible).

So when a user on my site performs a search, the script will be activated, the fields will be updated to the current month and current year (respectively) and the search will perform as expected.

All I need is help with the script.

How do I call for the current month and current year in a script?

Since the search is linked to a calendar I want the user to be brought to the current month and year.

http://mydomain.com/site/FMPro?-db=cal.fp5&-lay=detail&-format=format.html&-script.prefind=updateDates&month=[fmp-field: currentMonth&year=[fmp-field: currentYear]&-max=1&-find

Something like that...Where my script updateDates would do just that... update the two fields with the name of thecurrent month and the name of the current year... which would be global fields in the target database (cal.fp5).

Can anyone help me out with this? I would really appreciate it.

I have just read your message again. The url will not work because the [FMP-Field: currentMonth] and [FMP-Field: currentYear] tags will not have been replaced within the format file before it is submitted to FM.

Look at using the calculated field method. Alternatively, you can use Javascript to insert the current month and year into the url.

All the best.

Garry

The 'currentMonth' and 'currentYear' could be calculated fields. E.G.:

Month(Status(CurrentDate))

A script can use the 'SetField' step. The same calculation can be used.

All the best.

Garry

  • Author

Gary,

Thanks again for your response. I'll try Java, seems the way to go.

Create an account or sign in to comment

Important Information

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

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.