Changing caption dynamically using readonly DAC fields.

Other topics

How-To

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.

enter image description here

Place the added unbound field before the existing field.

Results:

enter image description here

Contributors

Topic Id: 8858

Example Ids: 27596

This site is not affiliated with any of the contributors.