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
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.
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?
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.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Tocauer 4
AlissonGodoy 2
NNaumenko 2