Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to have my document automatically select the max calendar year on open. I am trying to use document triggers to accomplish this. My first trigger is a Clear All. The next trigger is: =max(CalendarYear). Please see screenshot below.
The problem is that I only get the correct max year if no year was selected in the prior save. Otherwise, the year will show up as the one last saved despite the Clear All trigger and the Select in Field trigger.
Can anyone please help? Is this a bug?
Message was edited by: Alexander Grando Reason: Attached sample app.
Hi Alexander,
Try this:
=max( {1} CalendarYear)
Hi Juan,
Thanks for the response. Your expression works.
I also need to select the max MonthName in addition to the year. I tried including an additional Select in Field trigger with an alteration of your expression, but it didn't work.
Do you suppose you can help me out with this also? Thanks.
Alexander,
You can create a Flag in script for max year & month, and in the trigger you use only this field (the flag).
Or you can try this:
=max( {1<CalendarYear={"=$(=max({1}CalendarYear))"} >} monthnamefield )
If possible I would create a field in my data model that is a date for the first of the month. Then all you have to do is 1 trigger like
=max({1} MonthDate)
Juan,
I tried your new expression, but was unable to get it to work. I am attaching a sample app. Can you please show me how to set up the flag field? I am also OK with any other method to get this to work.
Hi Wallo,
I actually already have a single field that I can use to get the max date. But the reason I want to do one separately for year and another for month is to bring attention to the listboxes via the the green highlight color. Otherwise, they are only colored white if indirectly selected. Please have a look at my app above if you want.
Hi,
I just want to bump this thread because it has been several days since I've received a reply and my question remains unanswered.
Second action on CalendarMonthName for Select in Field.
=Month(MakeDate(max({1}CalendarYear), max({1<CalendarYear={'$(=max({1}CalendarYear))'}>}CalendarMonthName), 1))