How to create a dynamic action?

Estimated reading: 4 minutes 323 views

In Visual Guard, a dynamic action is an action that can be configured to change based on specific conditions or variables at runtime. This feature allows administrators to define actions that adapt to different contexts or data inputs, making it possible to apply customized security measures. For instance, a dynamic action might grant access permissions only if certain user roles are active, or it may trigger additional authentication steps based on the user’s profile.

Requirement to create the action;

  • You need to have declare PB Application on your VGRepository
  • You need to have connect PB Application to VGIdentityServer

Definitions of the details required while performing an action

  • Calling Object: Refers to the specific object within an application (like window object)that initiates an action or process, often interacting with Visual Guard’s security framework to apply permissions or conditions to user data.
  • Calling ID: A unique identifier or execution point (like constructor, open event, postinit events) associated with the calling object that initiates a specific action within Visual Guard’s security framework.
  • Target Object: The specific object within an application (like datawindow) that is affected by or responds to the action initiated by the calling object.
  • Action: The operation or task that Visual Guard is set to perform on the target object such as modify data or changing the properties. (like enable, disable, hide, show some properties etc.).
  • Parameters: The additional inputs or settings required by Visual Guard to perform an action, providing specific details or constraints.
  • Condition: The criteria that must be met for Visual Guard to execute a particular action on a target object, such as user roles or data values.
  • Tag: A label or identifier used to categorize or differentiate objects, actions, or conditions within Visual Guard for easier management and referencing.

How to create an action?

How to disable a button in a DataWindow?

To disable a button in DataWindows, you can use the Enabled property by dynamically setting it to false through code or by defining a condition within the DataWindow’s expression logic under parameters.


How to hide a button in a Window?

To hide a button in a Window, you can set its Visible property to Hide under ‘Action’.


How to hide a column in a DataWindow?

To hide a column in a DataWindow, you can set the column’s Visible property to false under the ‘Action’ and ‘Parameter’ row.


How to hide a menu?

To hide a menu, you can set its Visible property to false under the ‘Action’ row, effectively removing it from the interface until needed.


How to hide a PopMenu?

To hide a PopMenu, you can close or disable it programmatically by calling the Hide method under ‘Action’


How to hide a Tab menu?

To hide a Tab menu, you can set the Visible property of the specific tab page to Hide under the ‘Action’ row.


How to set permission on a DataWindow?

To set permissions on a DataWindow, you can control access by using conditional logic to enable or disable certain features (like editing, viewing, or deleting data) based on user roles or by applying expressions that govern the behavior of fields and controls.


How to enable several menus?

To enable multiple menus, you can programmatically set the Enable property under the ‘Action’ row, allowing them to be accessible and interactive in the application interface.


How to use a condition?

To use a condition in programming, you typically implement a conditional statement (like if, switch, or ternary operators) to execute specific code blocks depending on whether a certain criterion or expression evaluates to true or false.

Example: Address column is visible and payment column is unchecked in first row

Note: Here ‘fpaymentdue’ is a column with boolean value, and ‘faddress’ is an address column.

Result: Address column is hidden now


How to use the filters and parameters for DataWindows?

To use filters and parameters in a DataWindow, you can define dynamic criteria in the DataWindow expressions, allowing for the filtering of displayed data based on user inputs or predefined parameters.

Example: Country column having ‘USA’ and blank values

Note: The result will filter the DataWindow for Country value = ‘USA’.

Final Result: The blank row in the country column has been removed


How to use the filters with condition for DataWindow?

To use filters with conditions in a DataWindow, you can set the Filter property to a specific DataWindow condition, which dynamically limits the data displayed based on the criteria defined, allowing for more targeted data retrieval and visualization.

Note: The result will filter the DataWindow for Country value = ‘USA’ based on condition ‘fzip’ value, Here ‘fzip’ is a column with zipcode.