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:
- Create methods on table X and Y with parameters oldID and newID. The methods find records with oldID -> buf2buf -> change Id to newID - > insert
- On clicked method of button -> prompt user for newID with a normal dialog from code and call copy methods on Table X and Y
- 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)