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:
- If an element already exists that has the same Origin value as the imported element, replace the existing element and reuse its ID.
- 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.
- 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.
- 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:
- If an element already exists that has the same Origin value as the imported element, replace the existing element and reuse its handle.
- 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.
- 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 !