What you have is the definition for a custom function from FileMaker Custom Function:Mode ( ValueList ; Value; Cnt )
it just so happens that this is a recursive custom function so ...
Go ahead and create a new custom function.
Name it Mode.
Past in the calculation.
Add parameters ValueList, Value, Cnt and save.
Now this function is available to the calculation engine anywhere the calc engine is exposed.
This is another option to consider
Awesome that was a lot simpler than I thought!
Followed the above instructions and created a calc field in the Products thus:
Mode ( List (T15c_products_INVOICE_LINE_ITEMS||id_products|::Quantity) ; "" ; "" )
glad it worked. please mark as answered