Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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.

Posted

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

This topic is 8318 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.