Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Form Design Question

Posted on by 2,751

When using Edit in Grid on the Released Products form, if I launch the BOM Version form, each time I change to a new Released Product, the BomVersion form will update to show the bom information of the new record.  What controls this functionality?  I would like to duplicate it on the ProdTable and ProdBom forms.  Currently, when I launch the ProdBom from from Edit In Grid of the ProdTable form, the first bom displays, but the form is blank for all other records.

Thanks!

LJ

AX2012 R3 CU10

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Form Design Question

    i had a similar problem, recently, and Brandon Wiese put me in the correct direction for the solution. Dynalinks were the issue, and it turns out that thay sum up (in an AND statement) with other statements in the resulting sql query. What you should try is clearing the already active dynalinks within you queryBuildDataSource and then add the one you need.

    try reading this: 
    https://community.dynamics.com/ax/b/dynamicsaxinsightbyanas/archive/2014/07/22/ax-2012-add-dynalink-in-x

    h
    ope this was helpful.

  • lispyj Profile Picture
    lispyj 2,751 on at
    RE: Form Design Question

    This one seems like a linkActive() thing.  Without any customization, when I make a new selection in the ProdTable form (original form), the Title Bar of the ProdBom form changes, so there is some kind of link there.  I have tried adding some code to the link active method of the ProdBom datasource on the ProdBom form:

    if(ProdTable)

    {

    currentActiveProdBom = ProdBOM::findTransId(ProdTable.InventTransId);

    prodBom_ds.findRecord(currentActiveProdBom);

    }

    It didn't work, but it also doesn't seem necessary....the form already knows the new production order number.  I did try some AddDynalink() attempts, but they didn't work.

    I am still puzzled....

  • Suggested answer
    Brandon Wiese Profile Picture
    Brandon Wiese 17,786 on at
    RE: Form Design Question

    This feature of AX is called dyna-linking, and for the most part it works automatically.

    There are a few ways to help it work.

    You can establish a relationship between the tables in the AOT, under the Relations node of either the parent or child form, referring to the other.

    Or, you can establish the dyna-link manually, usually in the form init() method or the data source init() method.  In this case you use the SysDictLink class and add dyna-links to the data source dynalinks directly, typically referring back to the caller record recovered from element.args().record().

    Finally, you can add some code to the data source .linkActive() method, which fires anytime the caller record is changed, and then you can take field values from the caller record, again recovered from element.args().record() and modify the query as needed, calling .executeQuery() when finished to refresh the child form.

    There are many, many examples of all of these in the AOT.

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