Using the Upgrade Wizard

While upgrading the DAC items, the wizard does the following:
  • Adds the StorageName attribute and sets its value to "ExistingColumn" for an existing field.
  • Adds the StorageName attribute and sets its value to "AddColumn" for a custom field.
  • Finds and replaces all references to custom fields in the attributes of other customized fields, such as a PXSelector, PXParent or PXFormula. For example, the wizard inserts the typeof(DACNameExt.usrFieldName) reference in the PXSelector declaration instead of the typeof(DACName.usrFileName) reference.
While upgrading items of the Code type, the wizard processes each item to find references to the custom fields and replaces the references by using the following approach:
  • The wizard updates the references to the abstract class of the DAC field from DACName.usrFieldName to DACNameExt.usrFieldName, where the DACNameExt is the name of the new extension class.
  • The wizard replaces the references to the field Row.UsrFieldName with a reference to the field through the DAC extension: Row.GetExtension<DACNameExt>().UsrFieldName.

For example, the following code contains the references to the APRegister.usrVoucherNbr class and doc.UsrVoucherNbr field, which is a field customized based on the MSIL injection technology.


 sender.RaiseExceptionHandling<APRegister.usrVoucherNbr>(doc,
         doc.UsrVoucherNbr,
         new PXSetPropertyException("..."));

After technological upgrade for the customization of DAC classes in the project, the references will look as the following code shows. Now the code refers to the usrVoucherNbr class of the APRegisterExt extension class that will be generated during publication of the project.


 sender.RaiseExceptionHandling<APRegisterExt.usrVoucherNbr>(doc,
         doc.GetExtension<APRegisterExt>().UsrVoucherNbr,
         new PXSetPropertyException("..."));
Warning:
There might be a situation when a legacy customization includes two data access classes with custom fields that have the same names, such as DACName1.usrTheSameFieldName and DACName2.usrTheSameFieldName. When you upgrade the customization, the wizard replaces the Row.usrTheSameFieldName references to each field by using the following pattern: Row.GetExtension<DACName1Ext or DACName2Ext>().usrTheSameFieldName. The expression "GetExtension<DACName1Ext or DACName2Ext>" is invalid and causes a compilation error. You are supposed to review these references and insert the correct reference to the needed class, DACName1Ext or DACName2Ext.