web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Pass date value to a form

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    cpironmo Profile Picture
    2 on at

    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.

  • maram fraij Profile Picture
    on at

    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?

  • Verified answer
    Martin Dráb Profile Picture
    240,002 Most Valuable Professional on at

    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.

  • Suggested answer
    cpironmo Profile Picture
    2 on at

    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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans