Calculated fields not working with formula script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Juantreses
    Junior Member
    • Aug 2025
    • 4

    #1

    Calculated fields not working with formula script

    Hi all,

    I'm running into an issue where my calculated fields remain empty, even though I've defined a formula for them. Here's the context:
    • EspoCRM version: 9.1.8
    • Custom entity: BodyScan Click image for larger version

Name:	image.png
Views:	3
Size:	16.6 KB
ID:	120044spierpercentage is a readonly field that should be filled with a formula
      Click image for larger version

Name:	image.png
Views:	3
Size:	21.9 KB
ID:	120045
    • formula:
      Click image for larger version

Name:	image.png
Views:	3
Size:	14.3 KB
ID:	120046

      Despite this both vetmassa and spierpercentage fields remain null. I have verified the field names match. I've tried manually saving in the UI, clearing cache and running rebuild, checked logs: no errors to be found.

      Is there any issue in the way I've set this up? This is how I understood it from the docs. Any help is appreciated. Thanks!​
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9203

    #2
    Hi,

    There's no 'IF' function. You need to use 'ifThenElse' instead.


    Last edited by yuri; Today, 08:36 PM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...