PR Suggestion Addition
This commit is contained in:
parent
9093c1407b
commit
77fa3d8f7f
1 changed files with 6 additions and 0 deletions
|
|
@ -21,6 +21,12 @@ Using `SetAutoCalcFields` ensures that FlowFields are computed automatically whe
|
||||||
- Use `SetAutoCalcFields` before retrieving records (`FindSet`, `Find('-')`, etc.) when FlowFields need to be accessed.
|
- Use `SetAutoCalcFields` before retrieving records (`FindSet`, `Find('-')`, etc.) when FlowFields need to be accessed.
|
||||||
- Avoid redundant `CalcFields` calls if `SetAutoCalcFields` has already been used.
|
- Avoid redundant `CalcFields` calls if `SetAutoCalcFields` has already been used.
|
||||||
|
|
||||||
|
## SetAutoCalcFields on List Pages
|
||||||
|
SetAutoCalcFields can be utilized in the OnOpenPage trigger to ensure specific FlowFields are pre-calculated before the user interacts with the page. This is particularly beneficial for list pages where calculations are necessary but not included in the visible fields. However, it's important to note that any FlowField already displayed on the page will be calculated automatically, making SetAutoCalcFields unnecessary for those fields.
|
||||||
|
|
||||||
|
## SetAutoCalcFields or CalcFields
|
||||||
|
It's best practice to use SetAutoCalcFields when fetching a record since it ensures automatic FlowField calculation. On the other hand, CalcFields should only be used if you already have the record and need to explicitly trigger the calculation. This distinction prevents unnecessary performance overhead, ensuring that database queries remain optimized.
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
### Bad Code
|
### Bad Code
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue