Friday, October 25, 2013

AX 2012 - Deploying customizations across Microsoft Dynamics AX 2012 environments


HI

During deploy customizations across different environments, read WELL the link below :

Maintaining Installation-Specific Element IDs and Element Handles


However, the important things to know are :

During import, element IDs are assigned based on the following rules, in this order:
  1. If an element already exists that has the same Origin value as the imported element, replace the existing element and reuse its ID.
  2. If an element already exists that has the same Type, Name, and ParentID values as the imported element, replace the existing element and reuse its ID.
  3. If the imported element has a LegacyID value, and the LegacyIDvalue is available on the target system, add the following setting to the element: ID = LegacyID.
  4. Assign a new installation-specific ID from a guaranteed free range that does not collide with any LegacyID values.
    • For fields that are in tables that use table inheritance, use an ID number that is greater than 20000.
    • For fields that are not in tables that use table inheritance, use an ID number that is greater than 60000.
    • For indexes, use an ID number that is greater than 60000.
    • For all other elements, use an ID number that is greater than 100000.

During import, element handles are assigned based on the following rules, in this order:

  1. If an element already exists that has the same Origin value as the imported element, replace the existing element and reuse its handle.
  2. If an element already exists that has the same Type, Name, and ParentHandle values as the imported element, replace the existing element and reuse its handle.
  3. Assign a new installation-specific handle that uses the next free handle, or Max+1.

So, if during an Model import appear an error like :

"Violation of UNIQUE KEY constraint 'I_ModelElement_ElementName" . Cannot insert duplicate key in object 'dbo.ModelElement'. The duplicate key value is ObjectName.

mean that exist an different Object on Destination Environment with the same Origin Value Field of the ObjectName show in the error.
In this case, according the situation, we have to understand what's to do.
If is an useless object, you can start AX and delete it. Finally, rerun the import.


Enjoy !
 

No comments: