Creating an XDS Policy with performance in mind
You are here
Upgrade Data Dictionary Elements from 2012 to D365
Upgrading tables and EDTs from 2012 is a little different than everything else.
Following up from this and this article, let's talk about some of the data dictionary elements that we'll need to upgrade. We have a few specific scenarios we'll have to handle. Unlike refactoring some classes into the extension model, this is a more mechanical process that is more science than art.
Data Types
Base Enums
Any net new base enums can simply be moved from your overlayered model created by LCS into your target model. These would be found in a directory similar to K:\AosService\PackagesLocalDirectory\ApplicationSuite\ApplicationSuite.CUS Model\AxEnum. For more info, see this post.
Base Enum Extensions
Any changes to an existing enum will need to be manually evaluated and applied to the base enum if that enum allows it. Items requiring extension will be found in a directory similar to K:\AosService\PackagesLocalDirectory\ApplicationSuite\ApplicationSuite.CUS Model\AxEnum\Delta.Consider the compare on enum WHSExceptionType below:
As you can see, I have an overlayer that we need to create an extension for. Let's look at the property "IsExtensible" on this enum. Another way to check this is if you right click on a base enum, the "create extension" options will be grayed out.
As you can see, I can't extend this enum so I'll have to find another way to add my value or create an extensibility request with Microsoft.
You may also run into a conflict overlayer. This is when you have a duplicate element between the SYS/SYP layer and your layer, such as CUS. This would look like this:
If everything matches, you can simply remove the overlayer element.
If you have an enum that can be extended, you will want to do the following:
- Compare the overlayer and confirm this isn't a conflict overlayer, like above
- Create en extension on the base enum but do not open it
- open overlayered enum in designer view
- select all overlayered elements, right click then cut
- open the new base enum extension then paste
- remove the overlayered file for the base enum
Extended Data Types
Just like with base enums, any net new elements just need to be moved and any broken references resolved.
Extended Data Types Extension
For anything that is overlayered, first review what properties can be altered via an extension and also what properties have been changed. If there are properties that need to be altered via an extension, do the following:
- Make notes of what what changed on the base element
- Create an extension of the EDT
- remove the overlayered element (you can use source control to get it back if need be)
- open the extension and make the changes noted from the overlayered element
Data Model
Tables
Just like classes and everything else, anything net new just needs to be moved to your model.
Table Extensions
Moving overlayered tables into extensions is similar to upgrading a class but also an extended data type. There are two areas that we need to manage. First is the metadata on the table like its properties. Second is the code on the table. To manage the metadata, you will create a table extension. To manage the code, you will create an extension class tied to the table. First, let's cover metadata. Any new methods will show up in the metadata compare but we'll handle those later.
- Compare the metadata to the base element and note any changes
- delete the overlayered element
- create extension
- Open the extension and make the changes noted from the overlayered element
Next, we'll talk about code. Let's take a look at this example on table BOM.
Similar to with upgrading a call, we have to create a new class for this, like so:
[ExtensionOf(tableStr(BOM))]
public final class BOMTableBMC_Extension
{
public server static container BMCcreateBomDeleteItem(
container _packedQueryRun )
{
...
}}
We can have extension classes on tables and forms, It is a good idea to get in the habit of stating what the extension is an exactly of in its name. For instance, SalesTableTableBMC_Extension for the SalesTable table and SalesTableFormBMC_Extension for the SalesTable form. Next, remove the overlayered version and that will clear out the metadata related to the new folder on the base element.
Queries
Just like any other net new element, you just need to move it.
Query Extension
Queries can be upgraded from being overlayered similar to the way in which you would upgrade the metadata for a table.
Maps
Map cannot be extended in any way via any means. They are used less in D365 but if you need to make any changes, you'll going to hit a wall pretty quickly.
Data Entites and Extensions
Data entities from 2012 are not upgraded at all as of this writing. In 2012, these, as a concept, were sort of added as an after thought. However, in D365FO, these are now first class citizens so they are quite different and currently are not upgraded through the LCS code upgrade tool.