In add master/details, I need to control the detail it must have a item

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
asirha
User
Posts: 83
Location: iran
Contact:

In add master/details, I need to control the detail it must have a item

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

arbei
User
Posts: 9382

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


asirha
User
Posts: 83
Location: iran
Contact:

Post by asirha »

How I can check details items In Row_Inserting server event of the master table ?


arbei
User
Posts: 9382

Post by arbei »

You may check HTTP response in your browser, see what data is posted to the server from the browser.


asirha
User
Posts: 83
Location: iran
Contact:

Post by asirha »

I was not aware of this at all

Thanks for the advice


Post Reply