I am trying to override a status field when copying a record.
The following simple code in Row_Inserting causes an error when Copying that I can't trap
// Row Inserting event
function Row_Inserting($rsold, &$rsnew)
{
// Enter your code here
// To cancel, set return value to false
if ($rsold["Status"]=="Issued") {
$rsnew["Status"]="Draft";
}
Log("Old Status " . $rsold["Status"]);
Log("New Status " . $rsnew["Status"]);
return true;
}
If I add a new record, it is saved and log is:
[2022-07-26T00:23:58.080070+00:00] log.DEBUG: Old Status [] []
[2022-07-26T00:23:58.080336+00:00] log.DEBUG: New Status Draft [] []
If I Copy and save a record I get
Error
An internal error has occurred while processing your request.
and no logs or console messages. Using V2022.12
Any thoughts?