I want to use Multi-Update to execute my custom sql statement
but I don’t want to use the multi-update function itself, so I cancel it before it executes the multi-update.Currently I have it to return false but I still want a green toast message showing that my sql statement was successfully executed.
How can I modify it?
// Row Updating event
function Row_Updating($rsold, &$rsnew)
{
// Enter your code here
if ($this->CurrentAction == "update") {
// ...
$sql = "INSERT INTO other_Table (field1, field2, field3) VALUES ('...', '...', '...');"
ExecuteScalar($sql);
return false;
}
// To cancel, set return value to false
return true;
}
I got it to show green message with:$this->setSuccessMessage(“Success!”);but the page is just stuck in multi-page (internally it still thinks it failed) and doesn’t exit back to previous list page
I have fields that are checkmarked but I don’t want to save the changes.I will try using “unset(rsnew*)” to see if I can return true and not save the changesI’m using Multi-Update to trigger some actions, a for…loop through key-m to insert the selected records to another table.
I have fields that are checkmarked but I don’t want to save the changes.
It doesn’t matter actually if you don’t want to save the changes. You may then re-update again in Row_Updated server event from new values to the old values, so that the Multi-Update as if it had not happened.