AX2012 Model & Model Store

Hi Friends,

I am new to AX2012, I have gone through internet but ,I have few questions regarding models:

  1. When do we create a new model , per project wise or per client wise.

  2. As only a element can be a part of one model , the what happens if we need that element in other model?

thanks

It’s up to you how to organize your development. The general suggestion is creating a model per product, although you might want more granular units (e.g. a separate module for labels). Creating a new model for each project is normally not a good idea, because you’ll likely need the same AOT node in more than one project.

If you have models using the same object, your models are probably not well designed. Merge the models, move one of them to another layer or redesign your code (e.g. attaching events instead of changing a common method).

Hi Martin,

Much clear from your responce , thanks. however I have one confusion. For Models everywhere i find this:



Each element in a layer must belong to only one model.





However, I created two model in same layer and was able to put SalesTable from in both model.

Can you please explain what the above sentence means?

thanks,

It’s not the whole form what’s considered as “element” in this case. The form has methods, data source node and controls and each of them is a separate element with its own information about model. For example, you can’t have one method in two models, but you can have two methods in the same form belonging to different models.

But you can get into another problem - if you use source control (and you really should), it’s the whole form what’s versioned and it doesn’t work if sub-nodes belong to multiple models.

Hi Martin,

In .xpo file we can compare , and can select the code that is to be promoted. For ex, I have added Field F1 &F2 in a table ,i can compare and select only F1 to be promoted in TEST environment.

can we do the same with models? i mean if i am installing a model , can i compare and select only specific code to promote ?

please explain.

thanks

A model represents a part of your application to deploy. Think how it works with other software - if you want to install Word, for example, you also don’t get source code and don’t pick part of source code, don’t merge and compile it. You get a bunch of DLLs (and other files) that you merely install. If you want to install a different version of Word, you take a different set of installation files.

It’s the same with modules. If you need to add or remove some fields, you do it before distributing your code to customers or other environments. You don’t want any development activity in test and production systems, you want to install exactly the code that you prepared for installation. That’s what models are for. If you want to deploy another version of your code, prepare another model (e.from g. another branch in version control).

Thanks Martin,

it is clear for me now [:D]