Repository navigation
Releases: programmfabrik/fylr-plugin-formula-columns
Release list
v1.0.0
Formula Columns v1.0.0
A big update of the Formula Columns plugin. Until now, writing a formula meant writing it blind, committing the data model, editing a record and hoping for the best, and when it failed you got "the plugin caused an error" without knowing which of your formulas broke. This release fixes both.
Test a formula before committing anything
The formula editor has a new Test tab. Pick a real record (or use a generated demo record), change the values you want to try and press Run formula (or Cmd+Enter / Ctrl+Enter):
- Formula output: the value the column would get and its type, everything printed with
console.info/console.log, the log, the run time, and the error with its stack if it failed - Resulting record: the record as it would be saved
Nothing is saved and the data model does not have to be committed. It also works for columns that are saved but not committed yet, and for nested tables (one result per row).
Errors on the right field
A formula that fails now rejects the save and marks its own field in the editor. The message is listed under "Save not possible › Details":
Formula column person.demo_parity failed: Error: 7 is odd, please enter an even number
With ten formulas on an object type you see right away which one broke, and why. And since the message reaches the editor as it is, a formula can validate input: throw an Error with a message for the person saving the record.
New formula editor
- three columns: documentation, code / test, output / resulting record, each one scrolling on its own
- the documentation can be collapsed, like the quick access
- the help starts with what a formula returns: the value of its own column, in the format of the column type
- modern JavaScript like
1_000_000is no longer flagged as a syntax error - help texts in English, German, Spanish, Danish and Finnish
⚠️ Behaviour change
Before, a formula that threw an error was swallowed: the record was saved anyway and the column kept its old value. Now the save is rejected. If you have formulas that fail for some records, check them before updating. You can catch the error in the formula and return a fallback (see "Failing softly" in the README), or switch the formula off with "Disabled".
Requirements
- fylr 6.34 or newer
- testing a formula requires the system right
system.datamodel, the same people who can commit one
Get it
Install or update from the plugin manager, or download the zip:
https://github.com/programmfabrik/fylr-plugin-formula-columns/releases/latest/download/fylr-plugin-formula-columns.zip
The README has a quick start (5 minutes, the example above) and many more examples: https://github.com/programmfabrik/fylr-plugin-formula-columns#readme
Release v0.9.0
Pre-release for checking the fylr-build-plugin build pipeline (see #80307) — plugin content unchanged vs v0.8.0.
version 0.8.0
v0.8.0 Fixes translations and css styling of code editor See #76344
v.8.0.0
0.8.0 pre 1
Reapply "Added "plugin_user"" This reverts commit cc24dfc553e8bb3879abaf9631854600cb56a737.
Revert support for "plugin_user" (incompatible with fylr 6.22)
Revert "Added "plugin_user"" This reverts commit c72560261b4aeb0c55b770a2a7467ca2e1f72828.
Change of the new user config name
Changes the user config variable name.
Support plugin user
Added "plugin_user" see #76344
Fixed error output in ERROR event
Improved error catching and formatting
Before the actual JS error (from try { eval }) was not properly rendered into the ERROR event which was logged.
see #74054
v0.6.3
- Adds a new setting for disable the formula evaluation in a field without removing the script.
- Changes the evaluated function to be an async function, this let us to use promises and async code inside the formula code.
- Adds an utility function "async apiSearchBySids(sids, mode)" that help the user to fetch objects from the api using system_object_ids.
- Adds new information in the documentation next to the code editor. This includes the new function and the use of the variables log and info.