Skip to main content
Solved

Want to create DAC extension for the existing field in acumatica table


Forum|alt.badge.img

Hi,

I need to know, If I created a DAC extension table for the POline table and create a orderType field for the DAC extension.

Is it possible to get same orderType column data inside in the POLine table into my DAC extension orderType field.

ex: POline row 1 OrderType is ‘standard’ and My DAC extension orderType is same to with ‘standard’ type.?

 

Best answer by aaghaei

Sure but what is the benefit of redundant field? Also, You can not have duplicate names in the same table as OrderType already exists in the POLine table. You will need to read/watch the basics of customizations including naming conventions before starting the customization. All custom fields should start with Usr otherwise on updates Acumatica will DROP those fields which are not an Acumatica standard field and do not start with Usr.

This is a sample of adding a custom field to PMProject (Contract Table)

using PX.Data;

namespace PX.Objects.PM
{
    // PMProject DAC Extension
    [PXNonInstantiatedExtension]
    public sealed class USRPMProjectExt : PXCacheExtension<PX.Objects.PM.PMProject>
    {
        public static bool IsActive() => true;

        #region UsrField
        public abstract class usrField : PX.Data.BQL.BqlInt.Field<usrField> { }
        protected int? _UsrField;
        [ActiveProjectTask(
            typeof(PMProject.contractID),
            CheckMandatoryCondition = typeof(Where<PMProject.isActive.FromCurrent.NoDefault.IsEqual<True>>),
            DisplayName = "My Field")]
        public int? UsrField
        {
            get
            {
                return this._UsrField;
            }
            set
            {
                this._UsrField = value;
            }
        }
        #endregion
    }
}

 

 

View original
Did this topic help you find an answer to your question?

7 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1199 replies
  • Answer
  • March 16, 2023

Sure but what is the benefit of redundant field? Also, You can not have duplicate names in the same table as OrderType already exists in the POLine table. You will need to read/watch the basics of customizations including naming conventions before starting the customization. All custom fields should start with Usr otherwise on updates Acumatica will DROP those fields which are not an Acumatica standard field and do not start with Usr.

This is a sample of adding a custom field to PMProject (Contract Table)

using PX.Data;

namespace PX.Objects.PM
{
    // PMProject DAC Extension
    [PXNonInstantiatedExtension]
    public sealed class USRPMProjectExt : PXCacheExtension<PX.Objects.PM.PMProject>
    {
        public static bool IsActive() => true;

        #region UsrField
        public abstract class usrField : PX.Data.BQL.BqlInt.Field<usrField> { }
        protected int? _UsrField;
        [ActiveProjectTask(
            typeof(PMProject.contractID),
            CheckMandatoryCondition = typeof(Where<PMProject.isActive.FromCurrent.NoDefault.IsEqual<True>>),
            DisplayName = "My Field")]
        public int? UsrField
        {
            get
            {
                return this._UsrField;
            }
            set
            {
                this._UsrField = value;
            }
        }
        #endregion
    }
}

 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3398 replies
  • March 16, 2023

@jeewanishalika20  Why do you need to create the same field in the Extended DAC? what is the business scenario, behind this?

You cannot create the same field in the Extended DAC, Acumatica will not accept


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1199 replies
  • March 16, 2023

@Naveen Boga  At the same time we were writing the same thing. funny 😂


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1199 replies
  • March 16, 2023

@Naveen Boga It's funny. At the same time, we were writing the same comments :)


Forum|alt.badge.img

Hi @Naveen Boga ,

This is the related with the below issue.

We got a suggestion to create DAC extensions for  POOrder and POLine tables that we used in our customization.Using DAC extensions makes the tables independent from the original POOrder and POLine tables that’s requiring the Orderdate cannot be empty.

That’s why asking in here.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3398 replies
  • March 16, 2023

@aaghaei "Wow, what a coincidence!" :) 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2751 replies
  • April 19, 2023

Hi @jeewanishalika20 were you able to find a solution? Thank you!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings