Skip to main content
Answer

Database field is not created when publishing customization

  • November 11, 2021
  • 2 replies
  • 146 views

Freeman Helmuth
Semi-Pro I
Forum|alt.badge.img

Acumatica 2021R2

MySQL 8.0(tested on 5.7 as well)

 

When publishing this code, it publishes successfully but the database field doesn’t get created. What am I doing wrong?

using PX.Data.ReferentialIntegrity.Attributes;
using PX.Data;
using PX.Objects.AM.Attributes;
using PX.Objects.AM;
using PX.Objects.IN;
using PX.Objects;
using System.Collections.Generic;
using System;
using PX.Objects.EP;
using PX.Data.BQL;
using PX.Objects.CS;

namespace PX.Objects.AM
{
  public class AMWCExt : PXCacheExtension<AMWC>
    {
        //only enable this class if manufacturing is enabled
        public static bool IsActive() { return PXAccess.FeatureInstalled<FeaturesSet.manufacturing>(); }

        //WorkcenterEmployee field
        #region UsrWorkcenterEmployee
        //the acumatica database type is PXDBInt
        [PXDBInt()]

        //set the UI display name
        [PXUIField(DisplayName = "Employee ID")]

        //set the default value
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]

        //the ui control type is a selector
        [PXSelector(typeof(Search<EPEmployee.bAccountID>),
                                    typeof(EPEmployee.acctCD),
                                    typeof(EPEmployee.acctName),
                                    SubstituteKey = typeof(EPEmployee.acctCD))]
        
        //define the field
        public int? UsrWorkcenterEmployee { get; set; }
        public abstract class usrWorkcenterEmployee : BqlInt.Field<usrWorkcenterEmployee> { }
    #endregion

    }
}

 

Best answer by Naveen Boga

Hi @Freeman Helmuth  By publishing the extending DAC code file, fields will NOT be created in Database.

We need to these extended DAC fields to the package and do “Publish” the customization package.

Sample example for your reference,

 

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • November 11, 2021

Hello Helmuth, 

Having a Cache extension is not enough to actually create a DB column. 

To create a DB column, you need to include it separately in a customization package.

 

 

See here:

https://help-2021r2.acumatica.com/(W(45))/Help?ScreenId=ShowWiki&pageid=78783859-14f5-4b5d-a4a4-03cca2772ad2


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • November 11, 2021

Hi @Freeman Helmuth  By publishing the extending DAC code file, fields will NOT be created in Database.

We need to these extended DAC fields to the package and do “Publish” the customization package.

Sample example for your reference,