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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

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

(0) ShareShare
ReportReport
Posted on by 112

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

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    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.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans