April 19, 200223 yr 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.
April 19, 200223 yr 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
April 20, 200223 yr 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
Create an account or sign in to comment