Sunday, April 14, 2013

AX 2012 promoting code via XPO when usually doing model store move

Do the below at your own risk. I don't want anyone screwing something up and pointing the finger at me for something I accidentally omitted or something. I've done the process below a ton of times but never just from referencing an article. PRACTICE in a non-PROD environment first...

Occasionally there are small fixes (e.g. hotfixes) that don't need a model store move. It could just be a few lines of code in an existing object like a class or method. If a company usually does a model store move to promote the code, there are usually concerns about changing the usual promotion cadence.

You shouldn't have to worry about this too much as long as the changes will not change any ID values (e.g. creating new tables/fields). I wouldn't do an XPO move when deleting any of those objects either. It shouldn't cause a problem but just to be safe.

From Microsoft TechNet: Models, Layers, and the Model Store [AX 2012]:
"To avoid ID conflicts, we recommend that you do not use xpo export/import to move customizations in environments in which you are primarily relying on importing and exporting models and model stores. "

The above recommendation says to not move an XPO when primarily using model stores but its a very conservative stance. As long as you are confident the XPO move won't change or create any ID values, there should never be an ID conflict.

Steps to promote an XPO code into PROD (very simplistic).
  1. Import the XPO into the code
  2. Save and compile that specific object
  3. Compile the object forward if the object extends and is part of a framework (not doing this could cause your AOS to crash)
  4. Restart all AOS'es
I'll usually recommend doing more when doing a prod promotion like manually merge in the code via the compare tool, backing up the objects being moved, functionally test things afterwards, etc but the above are just the basic essentials.

No comments:

Post a Comment