hiin add master/detail , How can I control the number of detail records?in add master/details, I need to control the detail it must have a item and otherwise the insert operation will be aborted in master.I can check the details items with this code, but the problem is that a record is inserted in the master that has no details.
function Grid_Inserting()
{
$rsnew = $this->GetGridFormValues();
if ( count($rsnew) < 1){
return false;
}
return true;
}
Note that Grid_Inserting() is a server event for the detail grid, and detail records are inserted after the master record is inserted. You should use Row_Inserting server event of the master table.