1

Good morning, I want to add a new field on this screen Project Quotes but in doing so I get this message, that the table does not exist. How should or what is the way to achieve it.

Thanks in advance

Imagen 01

The added field in the database

enter image description here

He added the field in the database and then I generated my extension.

namespace PX.Objects.CR
{
    public class PMQuoteExt : PXCacheExtension<PX.Objects.CR.CRQuote>
    {
        #region UsrNota
        [PXDBString(-1, InputMask = "", BqlField = typeof(PMQuoteStandaloneExt.usrNotaText))]

        [PXUIField(DisplayName = "Nota ")]

        public virtual string UsrNotaText { get; set; }
        public abstract class usrNotaText : IBqlField { }
        #endregion
    }

    public class PMQuoteStandaloneExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>
    {
        #region UsrNota
        [PXDBString(-1, InputMask = "")]
        [PXUIField(DisplayName = "Nota ")]

        public virtual string UsrNotaText { get; set; }
        public abstract class usrNotaText : IBqlField { }
        #endregion
    }
}




    public class PMQuoteMaint_Extension : PXGraphExtension<PMQuoteMaint>
    {           
        public PXSelect<PX.Objects.CR.Standalone.CRQuote> Test;            

    }

However, when I record, it does not fill the field.

that I am making a mistake or doing wrong. Can you tell me please.

Thank you

Marco A.
  • 27
  • 5
  • your original image link is no longer pointing to the original error image. Please adjust it to keep this case properly documented – Fernando Sep 30 '19 at 18:40

1 Answers1

1

PMQuote is not an actual DB table, but a BQL projection between tables:

  • CR.Standalone.CRQuote
  • CROpportunityRevision
  • CR.Standalone.CROpportunity

The way that I would tackle this is:

  1. Add the field in table CRQuote
  2. Extend the graph and override the Projection with the inclusion of the new CRQuote field.

UPDATE: Based on @HB_Acumatica suggestion, step 2 would get simplified to a DAC extension (no need for the Graph extension). Much simpler to maintain in subsequent Acumatica versions!

UPDATE 2:

The extended DACs do not look correct in your question. Keep in mind that you should extend the original table (CRQuote), and the projection in order to have the value persisted. The following definition worked correctly on my end:

//Projection extension
  public class PMQuoteExt : PXCacheExtension<PMQuote>
  {
    #region UsrCustomField
    [PXDBString(100, BqlField = typeof(CRQuoteExt.usrCustomField))]
    [PXUIField(DisplayName="Custom Field")]
    public virtual string UsrCustomField { get; set; }
    public abstract class usrCustomField : IBqlField { }
    #endregion
  }
//Actual Table extension     
public class CRQuoteExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>
{
    #region UsrCustomField
    [PXDBString(100)]
    [PXUIField(DisplayName="Custom Field")]
    public virtual string UsrCustomField { get; set; }
    public abstract class usrCustomField : IBqlField { }
    #endregion

}

Result

DB

Fernando
  • 433
  • 3
  • 9