Update failed in Master/Detail Edit

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

Update failed in Master/Detail Edit

Post by anil »

In the Row_Updating event of Master and Detail pages, I wrote custom validations. If any validation fails, manually returning false. After correcting user input and submitting the form again, PHPMaker throws "Update failed" error message.


sangnandar
User
Posts: 980

Post by sangnandar »

Obviously there's something wrong with your validation code.
Post your code to more discussion.


anil
User
Posts: 24

Post by anil »

if ($rsnew['EXPERIENCE'] < 5) {
$this->CancelMessage = "Experience should be 6 or greater";
return false;
}
Example: When inserting record user entered value 10 and record is inserted. Now user is updating the value to 3 then it throws CancelMessage (Experience should be 6 or greater). Now user entered 6 then it throws "Update failed" error message.
This "Update failed" error message throwing by PHPMAKER and this is happening only in MASTER/DETAIL EDIT only, Not in MASTER EDIT Page.


sangnandar
User
Posts: 980

Post by sangnandar »

You should have return TRUE in your code otherwise it never get passed.
It should goes this way:

Row_Updating() {
if (something == wrong) {
return FALSE;
}
return TRUE;
}


anil
User
Posts: 24

Post by anil »

Row_Updating() {
if (something == wrong) {
return FALSE;
}
return TRUE;
}

By default return TRUE is available in Row_Updating() event last line.
I tried this but getting same problem.


mobhar
User
Posts: 11726

Post by mobhar »

Enable Debug mode from "Tools" -> "Advanced Settings" -> "Debug", regenerate ALL the script files, and then try again the generated web application, to check whether any server side error message returned.


sangnandar
User
Posts: 980

Post by sangnandar »

anil wrote:ai
This "Update failed" error message throwing by PHPMAKER and this is happening only
in MASTER/DETAIL EDIT only, Not in MASTER EDIT Page.

Updating in master/edit page have to pass both Row_Updating() event in master and detail page. Since it is ok in master edit, check Row_Updating() event in detail edit.


Post Reply