To Upgrade Technology for Legacy DAC Customization

In MYOB Advanced Customization Platform 4.2 and earlier versions, the customization of data access classes was implemented through the direct Microsoft Intermediate Language (MSIL) injection of custom fields into PX.Objects.dll. This resulted in a complex process of publication in which the original library was replaced with the modified version. In MYOB Advanced Customization Platform 2022 R2, the customization uses the technology based on class extensions and the DAC extension is compiled into a separate library that is dynamically merged with the original DAC by the platform at run time.

If you do not need to change the contents of a customization project, there is no reason to upgrade it. The system will successfully publish the project using the injection of custom fields into PX.Objects.dll in the newer version of the system as well. However if you have to continue the development of the project, we recommend that you upgrade the technology of DAC customization in the project.

The following sections provide detailed information:

To Upgrade a Legacy DAC Customization

To upgrade the legacy DAC customization to the technology based on class extensions, perform the following actions:

  1. Open the customization project in the Customization Project Editor. (See To Open a Project for details.)
  2. Click Data Access in the navigation pane to open the Customized Data Classes page.
  3. On the page toolbar, click Upgrade All, as shown in the following screenshot.
    Figure 1. Upgrading legacy customization


This action launches the upgrade wizard, which processes all the project items of the DAC and Code types to discover and update the following cases of DAC customization based on the MSIL injection technology:

  • A field of a data access class does not contain the StorageName attribute, which specifies the storage type of the field. For more information about the storage types, see Create New Field Dialog Box.
    Note: In the MYOB Advanced Customization Platform, you must select the way a custom field will be stored in the database when you add the field to a data access class.
  • The code contains a direct reference to a custom field of a row.
  • The code contains a direct reference to an abstract class of a DAC field.

See Using the Upgrade Wizard for details.

After the process is complete, the wizard opens the message box with the list of the items that have been upgraded (see the screenshot below).

Figure 2. Viewing the list of upgraded items


If there is no legacy customization in the project, the wizard opens a message box with the relevant information (see the screenshot below).

Figure 3. Viewing the message box that indicates no legacy customization in the project


To Upgrade a Library with a Legacy DAC Customization

If you have legacy customization of data access classes as a library (.dll) and have to modify the customization project, you can add the source code of the library as Code items to the customization project and then upgrade it as follows:

  1. In the Microsoft Visual Studio project of the library, for each source code file that contains a data access class customization, do the following:
    1. In Visual Studio (or any text editor), open the file, select All, and copy the source code to the clipboard.
    2. Create a new Code item in the customization project.
    3. Delete the code template from the created item.
    4. Paste the clipboard content into the item and save the Code item to the customization project.
  2. Upgrade the customization project.
  3. Test the upgraded customization project to ensure that the project is valid and applies to the system after publication.
  4. If you need to move the source code back to the library, use the clipboard and the copy-paste approach as well.