Good morning, please excuse the simplicity of this question but I am really struggling to resolve. I have inherited a CRM system and have come across an issue on updating records in a table, the insert works fine as below when attached to the OnAfterInsertRecord event
$lastInsertId = $this->GetConnection()->GetLastInsertId();
$sql = sprintf(“INSERT INTO tbl_lead (client_id, Cost) VALUES(%d, ‘%s’);”, $lastInsertId, $rowData[‘Cost’];
However, the update doesnt actually update, no error on page just nothing changes, this is attached the OnAfterUpdateRecord event.
$sql = sprintf(“UPDATE tbl_lead SET Cost = ‘%s’ WHERE LID = %d;”, $rowData[‘Cost’], $rowData[‘LID’]);
Can anyone see anything obvious why this wouldn’t work, or is it being added to the wrong event?