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 !
 

AX Utility and Tip


Cross References

Generate a project with application objects from "used by" cross-references

Setting breakpoints from cross reference and search result windows



ID change in Dynamics AX data dictionary

Restore AX database in different domain




What is my data distribution by company(DATAAREAID) for a specific Dynamics AX table?


A Power shell script for updating admin user SID and other details

“The Art Of Debugging” – Tip 3 – Instrumenting your code using the Event Log

Consuming a Web Service in AX 2012 is easy

Client Access Log (Dynamics AX 2012)

Export all shared projects

Online formatting Sql Stantement

Translate text with Microsoft Translator from AX

PowerShell script to restart Windows (AOS) services remotely

Cleaning up after AxBuild.exe

Changing the Background Color on AX Forms in AX 2012

Color code forms in AX 2012, depending on environment/company

AX 2012 Development Cheat Sheet / X++


Import\Export

AX 2012 Consignor solution available on CodePlex

Deployment Customizations across more Environment

Model store deployment using batch files

How We Manage Development - Automated Builds


Enjoy !

Thursday, October 10, 2013