i created a custom formula for test that returns the sum if 2 numbers,
it works fine , but i need to refrech the page manualy after each update to have the new value
it works fine , but i need to refrech the page manualy after each update to have the new value
PHP Code:
<?php
namespace Espo\Custom\FormulaFunctions\Math;
use Espo\Core\Formula\Functions\BaseFunction;
use Espo\Core\Formula\ArgumentList;
class SumTwoNumbers extends BaseFunction
{
public function process(ArgumentList $args)
{
// Check if exactly two arguments are provided
if (count($args) !== 2) {
throw new \Error('SumTwoNumbers function expects exactly two arguments.');
}
// Evaluate the arguments to get the numbers
$number1 = $this->evaluate($args[0]);
$number2 = $this->evaluate($args[1]);
// Return the sum of the two numbers
return $number1 + $number2;
}
}
Comment