Solved

Database field is not created when publishing customization

  • 11 November 2021
  • 2 replies
  • 99 views

Userlevel 4
Badge

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

    }
}

 

icon

Best answer by Naveen Boga 12 November 2021, 00:21

View original

2 replies

Userlevel 7
Badge +5

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

Userlevel 7
Badge +17

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,

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved