Hi,
I have 2 domains .. master and details.
Master{
String masterName;
static hasMany=[details:Detail]
}
Detail
{
String detailName ;
static belongsTo =[master:Master];
}
I have form that handle the save
def save = {
.....
def master = new Master(params);
params.detailsName.eachWithIndex(dtName, index ->
def detail = new Detail();
detail.detailName = dtName;
....
master.addToDetails(detail);
}
.....
master.save(flush:true);
}
when I called master.save(), if there are errors in detail, the master still saving the data. I want to know how to cancel master if there are errors in details and i would like to know how to track the errors in details ?
thanks