web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Pass date value to a form

    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
    RE: Pass date value to a form

    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
    236,865 Most Valuable Professional on at
    RE: Pass date value to a form

    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
    RE: Pass date value to a form

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans