Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Automatically merge enums [AX 2012]

Updated: August 6, 2012

Applies To: Microsoft Dynamics AX 2012 R2

Each code upgrade checklist in Microsoft Dynamics AX 2012 R2 contains the optional Automatically merge enums task, which is run before the application is compiled. This task identifies enums (enumerated data types) that differ between versions, but that can be merged automatically. By merging enums before compiling, you can reduce the number of compile errors and the time that is required to resolve code conflicts.

In the Automatically merge enums task, the upgrade framework checks for cases that meet the following conditions:

  • The customer has modified the enum in a higher layer, and that layer has fewer memberss than the lower SYS layer.

  • Microsoft modifies the enum in the SYS layer for Microsoft Dynamics AX 2012 R2.

  • The modifications do not conflict, that is, no two members share the same name or the same integer Enum Value property.

If these conditions are met, the upgrade framework merges the two objects. For example, an enum FOO has the following history:

  1. SYS ENUM FOO = A //Microsoft shipped enum FOO with value A in Microsoft Dynamics AX 2012 or Microsoft Dynamics AX 2012 Feature Pack.

  2. USR ENUM FOO = B //The customer added a value B to enum FOO in Microsoft Dynamics AX 2012 or Microsoft Dynamics AX 2012 Feature Pack.

  3. SYS ENUM FOO = A, C //Microsoft adds a value C to the enum in Microsoft Dynamics AX 2012 R2.

The following table illustrates this scenario.

Layer

Baseline value

Microsoft Dynamics AX 2012 R2 value

USR

A, B

SYS

A

A, C

The customized and default enums can be merged as follows. The merger copies the new Microsoft member C from SYS into the USR layer, since otherwise it would be masked by the higher layer.

Layer

Baseline value

Microsoft Dynamics AX 2012 R2 value

USR

A, B

A, B, C

SYS

A

A, C

When you click Automatically merge enums, a progress indicator shows that merges are occurring. When the merge process is completed, an Infolog window opens. This window lists each enum that was successfully merged and conflicting enums that could not be merged. The unmerged enums require manual conflict resolution.

ImportantImportant

Any change to an integer Enum Value property that is used in business data will require the creation of a data upgrade script to resolve the difference.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.