I run MenuFunction inside a class method to open a form.
How can I pass a date value from the method to the form to be used in a display method ?
*This post is locked for comments
Hi, that would be perfectly acceptable, another approach which may help would be to create a class that extends the Args class and you can then add say a parmDate() method or parmContainer() method.
This was you could directly pass a date object (parmDate) or a container (parmContainer), holding numerous date values?
If this answer has helped you please verify it to help others see and use the advice given. If not let me know and we can work on getting there.
Wouldn't passing an object (e.g. a Set of strings) be a little bit more object-oriented? You wouldn't have to bother with anything like string parsing.
Also note that if your date values come from a datasource, you can pass a reference to the data source.
Thank you Chris.
Just as an additional question, if I have to pass two date values, is it accepted to pass these values as comma separated string using Args.parm() method then do required string parsing in form init() method to retrieve these values?
Use the Args.parm() method on the Args object you pass to the menu item.
This method accepts a string value so set it using the relevant date2str method and then convert it to a date during the forms init() method using str2date method.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,104 Most Valuable Professional
nmaenpaa 101,156