context.UserData
Overview¶
Provide the ability to share data between "Server Script".
Properties¶
Since it is an ExpandoObject, you can add properties with any name.
Methods¶
There are no methods.
Usage Examples¶
In the example below, the first server script stores the information retrieved from the database in the user data MyData, and the second server script outputs the number of data items stored in the user data MyData to the log. The first condition is checked as "Before Update" and the second as "After Update".
JavaScript¶
JavaScript¶
Code Samples¶
1. Color rows on the index screen by comparing them with the average
On the index screen, get the average of an arbitrary numeric column in the table, and color each row depending on whether the record's value is lower or higher than the average.
Also, since the average only needs to be calculated once when the screen is displayed, it is stored in UserData and carried over to avoid unnecessary calculations.
JavaScript¶
Condition: Before opening the row
CSS¶
An example of the CSS settings.
Supported Versions¶
- Pleasanter 1.1.13.0 or later
- Pleasanter .NET Framework version 0.50.219 or later