Add support for programmatically triggering formula fields to evaluate

Barry SchnellBarry Schnell 💎💎
edited June 2018 in Ideas
Currently, there is no officially supported way to force a formula to re-calculate.  Coupled with the fact that there are several scenarios that should result in formulas automatically re-calculating but do not, providing an officially supported way to force them to re-evaluate would help close this gap.

For example, let's say Model A has a formula field that uses MODEL_LOOKUP to Model B.  When Model B changes, the formula field on Model A does not update.  Ideally this would occur automatically but by providing a way to force a re-calc, model events could be hooked on Model B to programmatically force Model A to re-evaluate formula fields.  This issue will become even more prevelant with the introduction of custom formulas.

The "Ask":

1) Document skuid.model.Model.evaluateFormulaFields - This evaluates all formulas in all rows for a given model
2) Document skuid.model.Model.evaluateFormulaField - This evaluates a single formula field on a specified row
3) Add support for forcing evaluation of formulas on an entire row - This would evaluate all formula fields on a specified row

Thank you!
6
6 votes

Awaiting Review · Last Updated

Comments

  • edited February 2017
    Hi Barry,

    I'll pass this along, and thanks for the suggestion.

    Don
  • Barry SchnellBarry Schnell 💎💎
    edited January 2017
    Thanks Don.  There's been several different cases recently in the forum where skuid customers could really use this functionality.  People are using it in an unsupported way which is never ideal so hopefully official support can be added soon.  Thanks again!
  • Matt SonesMatt Sones ✭✭
    edited February 2017
    Yes Yes Yes!

    Also, thanks for mentioning .evaluateFormulaField(), Barry. That should save a lot of processing time on some of our pages.


    If I may add #4, while we're at it?

    4) support for forcing evaluation of a single formula field (and any dependents) on all rows in a model.


    Perhaps the row argument in skuid.model.Model.evaluateFormulaField could be optional, and if left blank would evaluate the specified formula on all rows. Similarly, skuid.model.Model.evaluateFormulaFields could allow an optional row parameter which would fulfill the Barry's request in #3.
  • Barry SchnellBarry Schnell 💎💎
    edited January 2017
    Nice thought on #4 Matt, completely agree!
  • Matt SonesMatt Sones ✭✭
    edited August 2017
    Any progress on this, skuid?
  • Matt SonesMatt Sones ✭✭
    edited June 2018
    bump
Sign In or Register to comment.