Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Learn how to use defined fields with database functions in VDM to return user-specific values in views and filters.
What Are Defined Fields?
Defined Fields are custom values associated with WebReports users. These values can be inserted dynamically into a VDM view using a database function, allowing user-based filtering or data personalization.
Tip: Defined Fields are often used to restrict data for specific users, return custom display values, or pass credentials dynamically to filters or report content.
Why Use Defined Fields in VDM?
Tailor reports to the user running them
Dynamically pass login/user-specific info into a view
Eliminate hardcoded values and reduce maintenance
Create secure filtering by user roles or regions
Use Case: You want a manager to only see sales records from their assigned region. By using a defined field like RegionFilter, you can filter results dynamically based on who is logged in.
Where Can You Use Defined Fields?
Defined Fields returned via database functions can be used:
In the data results (detail, Finished Reports, Visualize)
As filter criteria within the FSGS section of the view
Steps to Use Defined Fields with a Database Function
Step 1: Open or Create a View
Open VDM
Create a new view or open an existing one
Step 2: Add a Custom Field/Function
Right-click in the Tables and Fields section
Select Add Custom Field/Function
Step 3: Enter the Database Function
In the function box, enter your defined field query identifier
(This was configured in WebReports)
Tip: Wrap the defined field in single quotes if it is a string value.
Example: 'UserNameUDF'
Step 4: Name the Column
Provide a name for the column you’re adding
(e.g., Username or LoggedInManagerID)
Step 5: Set the Connection
Ensure the Database Function connection is set to your WebReports connection profile
Step 6: Click Add
Click Add to insert the custom database function into your view
Tip: You can repeat this process to add multiple defined fields as needed
Step 7: Run the View
Click Run View
Confirm the returned values match the expected defined fields per user
Troubleshooting
If the data isn’t returning correctly, verify:
The defined field is correctly set up in WebReports
The function syntax is correct in VDM
The object identifiers match your database’s requirements (e.g., single quotes for strings)
Article Summary
Using defined fields with database functions in VDM enables personalized, user-aware reporting. By dynamically injecting values tied to a user’s WebReports profile, you can securely filter data or display custom content without duplicating views. These fields can be reused in Finished Reports, Visualize dashboards, or applied directly to filters for efficient, scalable reporting logic.
Comments
0 comments
Please sign in to leave a comment.