Monday 15 December 2014

XPO versus Model file

There can be scenarios where you have to decide either to deploy the AX objects by XPO or by a model file.
Deploying the objects by a XPO is a good option if you are working in a development/test environment and you want to  deploy your objects in another developer's system.
Where as,deploying the objects by a model file is a good option if you want to deploy/distribute the objects/solution to customers.

The following two cases must be taken care of while deciding to use XPO or Model file.

1) The XPO does not have the information of which change is related to which model, so whatever objects you import using the XPO, those objects will be  related the model you are currently working in. Lets suppose if you create a XPO on the ISV layer and then import this XPO on the target environment which is currently running on USR layer  then the imported objects will be created on the USR layer and not on the ISV layer. But if you want to specify the specific layer where your changes must be deployed then using the model file is the option. In that case, If you import a model file on an environment which is currently running on some other layer different than the imported models layer, then your changes will not be deployed on the current layer, but on the layer which was mentioned in the model file.

2) In deploying AX objects with a XPO, you can have a problem in the following scenario.
Lets suppose the project you want to deploy contains some table which have relations with each other. for example. Table A has relations with table B and table B has relations with table C.
In that case, after importing the XPO you will notice that there can be many errors that will come upon compilation. The reason of all the errors is that the table relations are not properly created  at all for some dependent tables. AX can not create a relation for table B in table A if table B is not created yet in the import procedure. Even after the table B is created, the relation in table A for table B is not updated/ fixed, not even if you manually restore and compile table A. As a result of this, you will get compilation error at every point  where ever the table buffer is used in your XPO's  classes or tables.
To fix that scenario, all you have to do is to import the XPO tables again. Importing the tables again will properly create the table relations thus fixing all the related errors. The occurrence of this problem comes only with XPO import/export. This problem can be avoided if you consider using a model file. Importing a model file one time will create all the table relations properly and there will be no need to import the model file again to fix the errors.

No comments:

Post a Comment