Loading ...

[PXHidden] vs [PXVirtual]: Hidden Gems of Acumatica Development

In Acumatica development, attributes like [PXHidden] and [PXVirtual] serve as powerful tools for managing how data is handled and displayed in both the user interface (UI) and the system's back-end logic. While both attributes influence the behavior of data access, they have distinct purposes and use cases. Let’s dive into these attributes and see how they can simplify your customizations.

What Is [PXHidden]?

The [PXHidden] attribute instructs the system to completely hide a specific data view from the user interface. Despite being hidden, the data remains accessible in code, making it ideal for background operations where the data doesn’t need to be displayed to the user.

[PXHidden]

public SelectFrom<SOOrder>.View orders;

How It Works:

·         Invisible in the UI: The orders view won’t visible in Customization editor, GI and Email Temaplates.

·         Fully functional in the code: You can still use it in event handlers, business logic, or other operations.

·         Common Use Case: Useful for calculations, background data validation, or integration scenarios where data is processed but not displayed.

What Is [PXVirtual]?

The [PXVirtual] attribute creates a virtual, in-memory table that is not tied to any physical database table. This makes it an excellent choice for temporary or calculated data that doesn’t need to be stored permanently.

[PXHidden]

public SelectFrom<SOOrder>.View orders;

How It Works:

·         Data exists only in memory: The data in orders is created dynamically and won’t be saved to the database.

·         Can appear in the UI: Virtual tables can be displayed in grids or other UI elements, depending on your configuration.

·         Common Use Case: Ideal for scenarios like temporary calculations, displaying results of a dynamic query, or handling complex data transformations without affecting the database.

Attributes like [PXHidden] and [PXVirtual] are small but mighty tools in Acumatica customization. By understanding their differences and applying them wisely, you can create efficient, secure, and user-friendly solutions. Whether you're streamlining UI data or optimizing background processing, these attributes help unlock the full potential of Acumatica’s development framework.