Update or Multi-Update

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mishanian
User
Posts: 120

Update or Multi-Update

Post 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";
}

mobhar
User
Posts: 11660

Post 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;
}

mishanian
User
Posts: 120

Post 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?


mobhar
User
Posts: 11660

Post 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.


Post Reply