Custom field on CR Quote screen

Hi Everyone,

If you try to add a custom field on CR Quotes in Acumatica 2018 R2 you may face very weird behavior – field is added, can be saved to database but as soon as you refresh screen or record valued disappears.
Acumatica CRM - QuotesThe reason of this issues is PXProjection that is described in my separate article: PXProjection – SQL Views using BQL 
This image show you how projection is defined in Acumatica CRM
Acumatica Projection in Qutes
PXProjection uses 2 Data Access Classes for quotes:

  • One class represents the table – PX.Objects.CR.Standalone.CRQuote
  • Another represents view as combination of DACs in select – PX.Objects.CR.CRQuote

And to correctly work, custom field needs to be added in both of the places. And Projection field should be linked to table field using BqlField property of DBFieldAttributes.
Unfortunately customization by default adds new field only to projection dac and not tho the real one.

But no worries, if something cannot be done automatically we can always do it manually:
Here we just add custom field twice – one time for PX.Objects.CR.CRQuote and than second time for PX.Objects.CR.Standalone.CRQuote
Please note that in the first field you should specify: BqlField=typeof(CRQuoteExt.usrCustomField)
Acumatica Quote Custom Filed

In the end (and after you publish) you will have 2 extension:

namespace PX.Objects.CR
{
    public class CRQuoteExt : PXCacheExtension<PX.Objects.CR.CRQuote>
    {
        #region UsrCustomField
        [PXDBString(100, BqlField=typeof(CRQuoteExt.usrCustomField))]
        [PXUIField(DisplayName="CustomField")]
        public virtual string UsrCustomField { get; set; }
        public abstract class usrCustomField : IBqlField { }
        #endregion
    }
}
namespace PX.Objects.CR.Standalone
{
    public class CRQuoteExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>
    {
        #region UsrCustomField
        [PXDBString(100)]
        [PXUIField(DisplayName="CustomField")]

        public virtual string UsrCustomField { get; set; }
        public abstract class usrCustomField : IBqlField { }
        #endregion
    }
}

Now your field will be automatically selected from the DB.

Have an easy customization!

2 Replies to “Custom field on CR Quote screen”

  1. I have a question that may be related to this one. I’m trying to add a custom field on both Location screen and Customer screen similar to the native fields provided by Acumatica (ex: Tax Registration ID, Tax Zone). These fields can be viewed/edited from either the Customers screen or the Locations screen.

    I think it may have something to CR.Standalone.Location DAC similar to what you’ve described here for CR.Standalone.CRQuote. But so far, I’ve not been able to figure out how to make it work.

    I posted on StackOverflow with more detail and screenshots at this link:

    https://stackoverflow.com/questions/52021382/same-custom-field-on-both-location-screen-and-customer-screen

    Can you point me in the right direction?

    1. Hi Ben,
      Location and address are different tables and they are not inherited from each other. So if you add field to location it can’t be used from address.
      There is a projection table that combines location and address – LocationExtAddress. In this case it will be related, but as far as I can see from your screenshot – you have just normal tables.
      What is the problem if you add field just on location? is that not shown?

Leave a Reply

Please rate*

Your email address will not be published. Required fields are marked *