Question

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

  • 14 December 2023
  • 0 replies
  • 13 views

Userlevel 5
Badge +1

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved