Tuesday, January 5, 2021

Flowfield and Flowfilters - #albacktobasics.

Hi Readers,

This year I am starting to talk about basics again.

I still get questions about basics and we all need to understand that basics are important while working on solution for our customers.

In this article we will talk about FlowFields and Flowfilters that was raised in one of the #bcopendiscussion.

Question - Can I use Flowfilter to filter data in page?

With this I thought it would be great to talk about virtual fields in details. In this article we will discuss in details about flowfield and flowfilter. #albacktobasics

FlowFields - 

FlowFields, display the result of the calculation described in the CalcFormula Property. 

Information in FlowFields exists only at run time, values in FlowFields are automatically initialized to 0 (zero).

There are Seven types of FlowFields as shown below.
  • SUM 
    • Sum of a Specific Column. 
    • FlowFields Data Type - Decimal, Integer, BigInteger or Duration
  • Average 
    • Average of a Specific Column. 
    • FlowFields Data Type - Decimal, Integer, BigInteger or Duration
  • Exist 
    • Any records exist in a specified set in a table.
    • FlowFields Data Type - Boolean.
  • Count
    • Number of records in a specified set in a table.
    • FlowFields Data Type - Integer.
  • Min
    • Minimum value in a column in a specified set in a table.
    • FlowFields Data Type - Any.
  • Max
    • Maximum value in a column in a specified set in a table.
    • FlowFields Data Type - Any.
  • Lookup
    • Looks up a value in a column in another table.
    • FlowFields Data Type - Any.

Example - 

If in a table you want to get Quantity that is sold for a customer and a item. To do this you can create a flowfield with CalcFormula to get sum of quantity from Sales Shipment lines as shown below.


Flowfilters -
  • Flowfilters fields to set ranges on the calculations that are shown in FlowFields (only)
  • Flowfilters is only to apply filter on FlowFields. 
  • FlowFields CalcFormula can contain ordinary fields and filters to filter the data during calculation.

Example - 

If you would like to filter the above data with location filter, we will create a new flowfilter and change the CalcFormula of Qty. Sold Flowfield as shown below.


Remember -

  • Both types of Fields are stored in the database.
  • Both types of Fields are not available in SQL Database.
  • Data Classification is not required when you define flowfield & flowfilter.
  • User cannot modify value of flowfield as its a calculated fields.
  • Flowfilter can be used in C/AL or AL code for filtering data in flowfield.

If you have any other basic stuff that you would like to discuss please let me know and I will try to write an article on this.

Let me know your views as comment to this article.

Regards,
Saurav Dhyani
sauravdhyani.com
#albacktobasics

2 comments:

  1. Nice one Saurav. Many programmers we come across do not know basics like this and try to bluff

    ReplyDelete
  2. Global Dimensions vs shortcut Dimensions

    ReplyDelete

Popular Posts