case 4577

This commit is contained in:
2024-04-08 21:17:26 +00:00
parent 176007864a
commit dce3e32c48

View File

@@ -249,6 +249,22 @@ The data provided to the report consists of the same fields visible in the user
The report data provided comes directly from the Server and is not translated or localized into the current User's format as that is the responsiblity of the "Client" end, see the [Localization and Translation](#localization-and-translation) section for details.
#### Viz fields in report data
You may notice many fields that end with the suffix "Viz" in the report data object.
The "Viz" suffix is appended to the name of any fields that are generated by the server dynamically when data is being generated for reports.
Typically, this is data that is not entered by the user or stored in the database for the specific object being reported. They are convenience fields to add more information for the user.
Most often a viz field comes from other related objects that link to the object being reported or they are generated dynamically for example calculations that don't need to be stored in the database for efficiency.
For example on a Work order report the field `CustomerViz` contains the Customer name for the Work order as the work order object itself does not store a Customer Name field as it may change and is not efficient to store directly in the work order object itself which only stores the internal ID number of that Customer's record.
Another example of a calculated Viz field is the `LineTotalViz` field on work orders which is calculated dynamically at the moment the work order report data is gathered to send to the report generator. No line total is actually stored in the database as it can be calcluated 'on the fly' when needed.
As the person editing a report template it can be helpful to know which fields are not stored directly in the object being reported if there is any question about where the value is coming from so we have adopted the standard of the "Viz" suffix.
#### Custom fields in report data
In AyaNova an object can have up to [16 customizable fields](ay-customize.md#custom-fields) of extra data.
@@ -613,10 +629,7 @@ async function ayPrepareData(reportData) {
//construct the POST object
let searchPostData = { phrase: "fish" };
reportData.myData.SearchResults = await ayPostToAPI(
"search",
searchPostData
);
reportData.myData.SearchResults = await ayPostToAPI("search", searchPostData);
return reportData;
}
```