Page 1 of 1
In add master/details, I need to control the detail it must have a item
Posted: Thu May 18, 2023 7:23 pm
by asirha
hi
in 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;
}
Re: In add master/details, I need to control the detail it must have a item
Posted: Thu May 18, 2023 9:43 pm
by arbei
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.
Re: In add master/details, I need to control the detail it must have a item
Posted: Thu May 18, 2023 10:45 pm
by asirha
How I can check details items In Row_Inserting server event of the master table ?
Re: In add master/details, I need to control the detail it must have a item
Posted: Fri May 19, 2023 9:12 am
by arbei
You may check HTTP response in your browser, see what data is posted to the server from the browser.
Re: In add master/details, I need to control the detail it must have a item
Posted: Mon May 22, 2023 5:25 am
by asirha
I was not aware of this at all
Thanks for the advice