Wednesday, April 18, 2012

Error: The name of Method YYYY doesn't match the name of the element in the lower layer. Ensure that the element’s name is the same as in the lower layer.

During a compile or compare, you may get an error, like this: 


Error:  The name of Method Renamed_insert doesn't match the name of the element in the lower layer. Ensure that the element’s name is the same as in the lower layer.


Check your attention span. Basically the resolution to this problem is in the infolog itself.

the key is in the part "Renamed_*******". The object has been renamed but retained its ID. So chances are, when you've been merging the object, you forgot/chose not to remove the obsolete object with the same ID.

It is not obvious for methods, since you cannot easily see the method's id.

The situation is cured with a cup of coffee and a meticulous compare of the layers. During a comparison of an old MS-provided layer (e.g. old syp vs new syp) you'll stumble upon a completely new added method and a removed method. 
Just remove the conflicting old method and you'll be all set!

And if you're missing such situations often, it's time for a break!

Once you're done with merging compile everything

Dynamics AX 2009 compare tool has some quirks. These quirks may sometimes conceal the new nodes.

So to catch situations like this - compile the whole AOT and resolve the errors.

It is very helpful to have compare the compilation output to a pre-roll-up environment so that you can identify the new problems caused by the roll-up/merge.

As always, comment your decisions and use //todo: to annotate next steps.

Tuesday, April 17, 2012

7 steps to merge a stubborn menu object when applying a rollup


Sometimes AX does not allow you to merge a menu by using the compare utility. You just click the arrow but… nothing happens.
menus not merging

Here is a workaround:
1.       Open the menu in two layers – one window each
a.       Right click on the Menu folder in question:

b.      Do this for the second layer in question
2.       Expand the nodes
3.       Copy the missing element to the outmost layer (e.g. CUS)

a.       Drag and drop the element, while pressing CTRL (that copies the menu item)
b.      Adjust the position of the menu item:
                                                               i.      Select the dropped element and hold ALT
                                                             ii.      Use up and down cursor arrows to move the element up/down
                                                            iii.      Click save on the window for the outmost layer (e.g. left window in this case)
4.       Repeat for all the missing elements. For elements to be removed, just delete them from the outmost layer.
5.       Close the windows and the comparison window.
6.       Re-run the compare to validate that the objects were saved.

Friday, April 13, 2012

How to resolve code conflicts



1.       Log into the layer you’re going to be resolving the conflicts for (cus)
2.       Open the upgrade layer conflict project (AxUpgradeLayerConflicts_cus)
3.       Select a class to resolve a conflict for (InvenCostItemDim)
4.       Right-click, Compare
5.       Optional – change the layers to compare – a SYP or GLP to the layer you’re in.
a.       I like to change select the SYP or GLP on top, because it will show up as red line, requiring my attention
b.      The cus layer will be blue, indicating the changes that we’ve made before (either via a hotfix application, customization or internal fix)
6.       Click Compare

7.       Select the first tree node with a red and blue square (it indicates a conflict)
8.       This means that the SYP layer from Microsoft has the _inventTrans.update without any parameters, and we have customized the method on the cus layer for some reason.
9.       The questions to ask are: what is the reason?
a.       Fix from MS that was earlier applied/made in CUS:
                                                               i.      if that is the only conflict in the method remove from CUS
                                                             ii.      if that is not the only conflict, then uplift the code to CUS, and remove your fix/hotfix
b.      Home-grown fix
                                                               i.      Same as above
c.       Customization
                                                               i.      Merge the fixes from MS into your customized method, leave your customizations intact
9.       Depending on the answers above, either skip the method or use arrows to move the code into the cus layer or remove the code.
9.       Proceed until you’ve resolved all the subnodes
Code upgrade process in dynamics ax 2009

9.       Close Compare window and save the object
9.       Mark the object as resolved

9.       Repeat until the day is over or you’re done with classes.
  .    When done, you can re-compare the classes. If there are no differences, it makes sense to delete the outward layer, e.g. cus.
.
This is a how-to blog, describing the journey of applying a rollup 8 to dynamics ax 2009 with global GLS layer.
The reason for this blog's creation is that the upgrade guides omit the description of

  • the mechanics of applying a rollup
  • conflict resolution 
  • uplifting the patched code to the outmost layer


The blog is intended as an illustration and insight and a comprehensive description. No warranties are provided or implied. Use procedures described here on your risk and ALWAYS test the upgraded code before rolling it our to production.
Let's roll!