Skip to main content
Solved

How to Create a Field That Auto-Updates Based on Other Fields and Allows Manual Edits in Acumatica?

  • 25 July 2024
  • 1 reply
  • 38 views

Hi,

I need to create a field in Acumatica that automatically updates its value based on the input of other fields. Additionally, this field should also be manually editable by users. Is it possible to achieve this in Acumatica? If so, could someone please provide detailed steps or guidelines on how to implement this functionality?

Thank you in advance for your assistance!

1 reply

Userlevel 6
Badge +4

Hi @RKarunarathne51 

  1. You need to Create custom field as below in specific DAC.
 #region UsrField
[PXDBDecimal]
[PXUIField(DisplayName = "Calculated Field")]
public virtual decimal? UsrCalculatedField { get; set; }
public abstract class usrField : PX.Data.BQL.BqlDecimal.Field<usrField> { }
#endregion
  1. Then implement the logic in the field updated event on which field you need to update the custom field.
    protected void APInvoice_CuryTaxTotal_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
    {
    // implement logic to update the field
    }
    1. Use RowSelected event to make the field editable. 
      PXUIFieldAttribute.SetEnabled<APInvoiceExt.usrField>(cache, row, true);

      Hope, it helps!

Reply