Skip to main content
Post a question

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to pass init Form range to Form button as parameter.

Posted on 31 Aug 2018 11:36:49 by 110

Hi All,

Please bear with me, need some help on how to:

I created a view called "PriceDiscView", I use this view as datasource of my form called "PriceDiscForm". I put init method with below codes:

3531.init.PNG

Form is like this:

init-q.PNG

data.PNG

My target is this: I want to update the "ToDate" field of all records generated covered by the init parameter by click the "UpdateButton". another form will pop up asking what is the new value of "ToDate".

Thank you in advance.

Regards,

r0bert

*This post is locked for comments

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on 31 Aug 2018 at 11:51:19
    RE: How to pass init Form range to Form button as parameter.

    So you need a button, on the button click show new dialog to ask for a date (something like here docs.microsoft.com/.../how-to-create-a-dialog-form but not that complicated). Grab a date from the dialog and run though the query you have in init (move it to class declaration) and update all the records with new date. If user can delete records on the form you can go though all the records on the form using MultiSelectionHelper community.dynamics.com/.../get-select-records-by-multiselectionhelper-class instead of using query.

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on 31 Aug 2018 at 11:48:35
    RE: How to pass init Form range to Form button as parameter.

    Hi!

    You need to create a new runBase class which contain a dialog with "ToDate" field. From UpdateButton clicked() method call a new class and pass your query as a parameter. Inside your class get the table cursor from queryRun.get() and update it.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans