Hi, Readers.
In this post, I would like to discuss a common error when adding flowfield fields in Business Central.
As you may know, the flowfield fields are used extensively in standard codes. And this is a very powerful feature in Business Central and NAV.
After you have added a flowfield field and displayed it on the page. Have you encountered the following error when opening the page? (Although there is no problem in publishing extensions and installing extensions)
A flow field is part of the query column list, this is not supported
Page View – General Ledger Entries has to close.
![](https://yzhums.com/wp-content/uploads/2021/03/image-442-1024x443.png)
Let’s see a simple example.
We need to display the current inventory in the Item Journal Line.
![](https://yzhums.com/wp-content/uploads/2021/04/image-104-1024x473.png)
Because the Inventory field is existing on the Item List, just create a new field and use flowfield to display the data.
![](https://yzhums.com/wp-content/uploads/2021/04/image-102.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-103.png)
Test Video: An error will occurred.
However, if “Description” is displayed instead of “Inventory”, there is no problem.
![](https://yzhums.com/wp-content/uploads/2021/04/image-101.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-100-1024x369.png)
Why?
The reason is a flowfield on a field that is also a flowfield.
This is a very insidious problem need to be attention, as it will not report any errors when compiling in VS Code, but will cause the page to fail to open.
![](https://yzhums.com/wp-content/uploads/2021/04/image-105.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-106-1024x356.png)
So what should we do? You have to change your mind.
if you still want to use the flowfield field on the new field, you need to display a non-flowfield field.
For example:
![](https://yzhums.com/wp-content/uploads/2021/04/image-108-1024x385.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-107-1024x438.png)
If you insist on displaying the flowfield in the reference table, you need to add an actual field or variable to display the result of the flowfield calculation.
For example:
![](https://yzhums.com/wp-content/uploads/2021/04/image-110.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-111.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-109-1024x381.png)
Find out more about FlowFields (Sum, Average, Exist, Count, Min, Max, Lookup).
END
Hope this will help.
Thanks for reading.
ZHU
コメント