Loading ...

Dynamic Field Visibility in Acumatica: A Practical Guide

Customizing field visibility based on conditions is a frequent requirement in ERP systems like Acumatica. One common scenario is enabling or disabling a combo box based on another field's value. In this guide, we’ll explore how to achieve this using Acumatica's tools, covering both low-code and code-based approaches.

Scenario

A user wants a combo box to activate only when a customer account's status changes to "OnHold." The field should also clear automatically when the status returns to "Active" or another value.

Low-Code Approach Using Acumatica's Workflow Engine

For users less familiar with C# and Visual Studio, Acumatica's Workflow Engine provides a low-code solution:

  1. Access the Workflow Engine:

     Navigate to the Customization Projects workspace.

     Open the specific screen's workflow customization.

  1. Define Conditions:

     Use the Hidden or Enabled property for the target field.

     Set the condition to activate the combo box when the customer status is "OnHold."

  1. Apply Changes:

     Save the workflow.

     Publish the customization to see the changes in action.

Advantages:

     No coding required.

     Easy to maintain and modify.

Code-Based Approach for Enhanced Control

For more complex scenarios or greater flexibility, a code-based solution is recommended. Below is an example implementation:

Step 1: Create an Event Handler

Customize the RowSelected event of the relevant DAC:

Step 2: Add Attributes to the DAC

In the DAC for the combo box field, add the following attributes to control visibility and behavior:

[PXUIEnabled(typeof(Where<Customer.status, Equal<CustomerStatus.hold>>))]

[PXUIRequired(typeof(Where<Customer.status, Equal<CustomerStatus.hold>>))]

[PXDefault]

Step 3: Publish the Customization

  1. Save the code in your customization project.
  2. Publish the changes to apply them to the target screen.

Choosing the Right Approach

     Low-Code Workflow: Ideal for straightforward conditions and quick setups.

     Code-Based Solution: Suitable for advanced scenarios, including additional logic like clearing fields or interacting with other fields.

Key Takeaways

  1. Use low-code workflows for quick adjustments and simple conditions.
  2. Opt for C# customizations when dealing with complex business logic.
  3. Familiarity with C# and web development can significantly enhance your ability to create tailored solutions in Acumatica.

By leveraging these techniques, you can dynamically control field behavior, improving both user experience and data integrity in Acumatica.

Be the first to rate this post

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5