I am working on Formula fields. It's basically a method to define calculated fields without writing a PHP calculated field function.
In the form configurator, you will be able to define, for any field, its formula, using placeholders to refer to current table fields or linked table fields.
For example, in a products table, you could define the final_price field as:
(where sales taxes are 22%)
In a customers table having id_city as lookup field, you could refer to the current customer's city values in the cities table just by calling their names e.g.
In an invoices_table having as items table an invoice_items table, you can define the total_amount field as:
At the moment, it is possible
Please share your thoughts on:
Best,
In the form configurator, you will be able to define, for any field, its formula, using placeholders to refer to current table fields or linked table fields.
For example, in a products table, you could define the final_price field as:
Code:
( {price} - {discount} ) * 1.22
(where sales taxes are 22%)
In a customers table having id_city as lookup field, you could refer to the current customer's city values in the cities table just by calling their names e.g.
Code:
{cities.name_city}
In an invoices_table having as items table an invoice_items table, you can define the total_amount field as:
Code:
SUM( {invoice_items.price} * {invoice_items.quantity} )
At the moment, it is possible
- to refer to the current form values
- to refer to a linked record values
- to aggregate records that are in master/detail relationship with the current record, using SUM(), COUNT(), MIN(), MAX(), AVG()
- to use parenthesis
- to use basic math
- days_diff(): difference between two dates, in days
- month(), year(): extract month or year from a date
- round()
Please share your thoughts on:
- Common operators you frequently use that at the moment are not supported
- Specific use cases where formula fields could replace calculated fields
- Any other features or enhancements you would like to see related to formula fields.
Best,
Upvote
0