Page 1 of 1

Update or Multi-Update

Posted: Thu Mar 23, 2023 1:04 am
by mishanian

Hi, how I know that in the function Row_Updating,
did it come from multi-update or update (edit) of one record?

function Row_Updating($rsold, &$rsnew) {
if (CurrentPageID()=="update"){
 echo "update";
}

Re: Update or Multi-Update

Posted: Thu Mar 23, 2023 8:12 am
by mobhar

Make sure you do not remove return true; code in that Row_Updating server event, so your code should be:

// Row Updating event
function Row_Updating($rsold, &$rsnew)
{
    // Enter your code here
    // To cancel, set return value to false

    if (CurrentPageID()=="update"){
        $this->setMessage("Multi-Update here"); // just to make sure
        return false; // we need this to hold for a while, remove this line to proceed
    }
    
    return true;
}

Re: Update or Multi-Update

Posted: Thu Mar 23, 2023 10:42 am
by mishanian

Thanks, the only issue CurrentPageID() for multi-update and the update is the same.
is there any way that the program could recognize it comes from multi-update or update, on the Row_Updating function?


Re: Update or Multi-Update

Posted: Thu Mar 23, 2023 11:03 am
by mobhar

mishanian wrote:

CurrentPageID() for multi-update and the update is the same.

Did you mean edit instead of update? If so, then you may check:

if (CurrentPageID()=="edit") {
    // ... for single edit page
}

Please note that Multi-Update uses CurrentPageID as update and Single Edit page uses CurrentPageID as edit. Please CMIIW.