Skip to main content

Hi Team,

I have added a custom dropdown field to the Acumatica Quote (PM304500) screen. I want this field to be editable when the status is "Prepared," but it automatically becomes non-editable when the status changes. I have tried writing code in the Row_Selected event for the field to make it editable, but it's not working. Kindly provide me with a solution or let me know if there's a mistake I am making that is preventing it from working.

 

added this field in the  public class CRQuoteExt : PXCacheExtension<PX.Objects.CR.Standalone.CRQuote>

 #region UsrClosed
PXDBString(1)]
PXStringList(new stringi] { "W", "L" },
new stringi] { "Won", "Lost" })]
PXUIField(DisplayName = "Closed As")]
public virtual string UsrClosed { get; set; }
public abstract class usrClosed : PX.Data.BQL.BqlString.Field<usrClosed> { }
#endregion

also added this field  public class PMQuoteExt : PXCacheExtension<PX.Objects.PM.PMQuote>
  { #region UsrClosed
         PXDBString(1,BqlField=typeof(CRQuoteExt.usrClosed))]
        PXStringList(new stringL] { "W", "L" },
                      new string ] { "Won", "Lost" })]
        ,PXUIField(DisplayName = "Closed As")]
        public virtual string UsrClosed { get; set; }
        public abstract class usrClosed : PX.Data.BQL.BqlString.Field<usrClosed> { }
        #endregion

 

added this code 

protected void PMQuote_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = (PMQuote)e.Row;
var rowExt = PXCache<PMQuote>.GetExtension<PMQuoteExt>(row);
if (row.Status == "A")
{
PXUIFieldAttribute.SetEnabled<PMQuoteExt.UsrClosed >(e.Cache, e.Row, true);

}
}

 

Be the first to reply!

Reply