evildan Posted April 19, 2002 Posted April 19, 2002 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.
Garry Claridge Posted April 19, 2002 Posted April 19, 2002 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
Garry Claridge Posted April 20, 2002 Posted April 20, 2002 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
evildan Posted April 24, 2002 Author Posted April 24, 2002 Gary, Thanks again for your response. I'll try Java, seems the way to go.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now