Add new unbound field to the DAC. (as readonly)
[PXString(60, IsUnicode = true)]
[PXUIField(Enabled = false, IsReadOnly = true)]
public virtual string UsrReadOnlyAcctName{get;set;}
public abstract class usrReadOnlyAcctName : IBqlField{}
Modify its value depending on conditions using handlers. (On Customer cycle ID Selected)
public class CustomerMaint_Extension:PXGraphExtension<CustomerMaint>
{
protected void Customer_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
var customer = (BAccount)e.Row;
var customerExt = customer.GetExtension<BAccountExt>();
if (customerExt != null)
{
customerExt.UsrReadOnlyAcctName = customer.AcctName;
}
}
}
SuppressLabel(true) for both new unbound fields and existing fields whose label will be replace.
Place the added unbound field before the existing field.
Results: