Skip to main content
Question

field to be editable when the status is "Prepared' in Quote screen

  • 14 December 2023
  • 0 replies
  • 27 views

Sagar Greytrix
Captain II
Forum|alt.badge.img+2

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 string[] { "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

also added this field  public class PMQuoteExt : PXCacheExtension<PX.Objects.PM.PMQuote>
  { #region UsrClosed
        [PXDBString(1,BqlField=typeof(CRQuoteExt.usrClosed))]
        [PXStringList(new string[] { "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);

                }
   }

 

0 replies

Be the first to reply!

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