Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Form Design Question

Posted on by 2,695

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

Categories:
  • 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,695 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans