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)

Data transfer with DropDialog

(1) ShareShare
ReportReport
Posted on by 3,542

It's my first time working with AX2012. But I guess the solution would be more or less the same in D365. My knowledge of code on forms is also limited.

Form A displays records from table X. Table X has children in table Y.

I need to implement a button on form A which duplicates a record X and all its Y children. A dialog is needed to specify a new ID for the duplicate record X.

I completed the project in more or less 10 seconds with the following method:

  1. Create methods on table X and Y with parameters oldID and newID. The methods find records with oldID -> buf2buf -> change Id to newID - > insert
  2. On clicked method of button -> prompt user for newID with a normal dialog from code and call copy methods on Table X and Y
  3. Refresh datasource on form A

My boss now wants a drop dialog instead of a normal pop-up - back to the drawing board for me.

  • I don't know how to create a drop dialog from code, so I created a form in the AOT from some existing example. Is this the correct method? I't feels like overkill as I only need one field.
  • I plan to get the record to be duplicated through args. And then when OK is clicked on dropdialog -> do the actual copy. But then where do I refresh datasource on form A? Should I access form A through args aswell? And refresh its datasource on the dropdialog form?

Sorry for the long post. Thanks for reading.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Pete Alberts,

    It's not an overkill, please check standard form "SalesCancelOrderDropDialog" It could be used as an example for you as it does refresh of parent forms datasource. 

  • Pete Alberts Profile Picture
    3,542 on at

    Thanks, I looked at that form and it helped a lot.

    The mentioned form "refreshes" the parent form's datasource with the research() method. There are three methods that I am aware of that seem to have something to do with "refreshing" a form data source: research(), refresh(), reread(). So most of the super-seniors at my company use the classic developer method - just call all three. Any comments on the difference between these methods or somewhere I may read more?

    (This should be a new post, but I'm lazy and I if there was a max questions per week rule, I'd be way over.)

  • Mea_ Profile Picture
    60,284 on at

    Just read this http://kashperuk.blogspot.com/2010/03/tutorial-reread-refresh-research.html and give you seniors to read. 

  • Pete Alberts Profile Picture
    3,542 on at

    Thanks, much appreciated.

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