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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Product Builder hierarchy

(0) ShareShare
ReportReport
Posted on by 1,719

Hi all, I have some questions about the variable hierarchy between two product models.

This is what I am doing:

- Create a parent product model A with variables X and Y. Those two variables are going to go to a child model and then returns to the parent, so in the nodes tree I create a code node that shows the variable value, then a BOM node that calls to a sub-model (when the variable value will be inherited, changed and then returned to the parent) and in the end another code node where I show the actual variable value (I expected the changed values here).

- Create a child product model B with same variables X and Y, same type, same name, and I check this ones with the "Inherits" option. This should take the variable value from the parent model on runtime, and this is working fine. In adiction I check the "Return value" option in those two variables for the value be returned to the parent model (I supose, when the execution of the child finished ¿?).

What I expected to this test to work is: Variables go parent->child, child changes the variables values and returns them to the parent. That is, parent model shows initial value, runs the child model and when it shows the actual values after the child execution the values should be changed, but they are not.

Don't know if I are explaining my problem quite well ...

( sorry for my bad english i hope it will be almost understandable ;) )

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Re: Product Builder hierarchy

    Hi, JA.Estevan

    I beleive I have an answer about this issue. It is definitely an bug, and it was fixed already and released as KB (knowledge base) article. That's why it hasn't been included in dis or syp layer. 

     The issue is only in one 'missed' symbol :) Take a look at \Classes\PBATreeNodeCompile\PBAVarMethods method, line #101 -

    PBATableVariable.Vartype            == PBAvartype::Datatype     &&

    shold be changed like:

    PBATableVariable.Vartype            <= PBAvartype::Datatype     &&

    And do not forget to recompile all your product models in order to change PB generated classes.

    The reason is that we need to inherit and return all variables with type less or equal than Data type (take a look at tabs at PB model (Modelling variables, System, Simple, Data type, Table, Class) and at PBAVarType base enum). We can't inherit and return back Tables and Classes, all other variable are operable :) But be carefull with System, Simple and Data type variables: the reason is that PB doesn't validate inherited variable for type-compatibility, unfortunately.

    Hope it will help you

    Thanks

    /Viktor

     

  • jaestevan Profile Picture
    1,719 on at
    Re: Product Builder hierarchy

    Thanks a lot!

    This is working fine with that change.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans