Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem of getting the max date selected in a list box. I am not sure how this needs to be done. Greatly appreciate any advice.
Thanks,
Gayan.
You can try using the OnOpen document trigger.
Why does it need to be done? What's the problem with letting the user decide which date should be selected? Sort the date listbox in descending order if necessary to let the user easily select the maximum date.
Hi Gysbert,
The reason being I need to keep the most recent date selected by default so that the users when opening the document will first see the most recent details and if needed can select previous dates.
Hope this helps.
Gayan.
You can try using the OnOpen document trigger.
Thanks Gysbert,
Is it the 'select in field' action we need to use?
Yes
Thanks Gysbert and Marco for the illustration. I tried adding the action but on the reload, I cannot get the list box to highlight the max date. Is it something I've missed? The list box controller has the 'census_time' assigned. I have attached the screenshot of the action.
I would create a text box with the same expression (=max({1} census_time) to check if the this is the same format as the format of census_time in the document properties. If the format is different, I would think that the selection won't be made. So you will essentially have to force the format to be the same one by using Date function if census_time is a date.
I hope this helps.
Best,
S
Hi,
I have no idea how you data looks like but what happens if you just use the max(census_time) as I assume your users dont have any other selections triggered on document opening?