I am using version 2021. the below mentioned function was accurately working in previous versions.
// Row Inserted event
public function rowInserted($rsold, &$rsnew) {
//echo "Row Inserted"
//var_dump($rsnew);
//die();
Execute ("update orderdetails set value_units = '" . $rsnew['orderdetails_unitprice'] . "' * '" . $rsnew['orderdetails_qtyout'] . "'
where orderdetails_lineid = '" . $rsnew['orderdetails_lineid'] . "'");
}
but now i am facing following error:/home1/invoisin/public_html/volta/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php(128): An exception occurred while executing ‘update orderdetails set value_units = ‘’ * ‘’ where orderdetails_lineid = ‘91’’: Truncated incorrect DOUBLE value: ''any idea ?
As the error said, the SQL is invalid. You should check if $rsnew[‘orderdetails_unitprice’] and $rsnew[‘orderdetails_qtyout’] have values first. If not, skip the update or set the value to 0 first.
/home1/invoisin/public_html/volta/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php(128): An exception occurred while executing ‘update orderdetails set orderdetails_unitprice = ‘’ where orderdetails_lineid = ‘97’’: Incorrect double value: ‘’ for column invoisin_volta.orderdetails.orderdetails_unitprice at row 1error is still the same .
Another thing i need to mention here that this is a master/detail form.
As the error message said your value (empty string) is incorrect.That’s why I wrote:
You should check if $rsnew[‘orderdetails_unitprice’] and $rsnew[‘orderdetails_qtyout’] have values first. If not, skip the update or set the value to 0 first.