Paul McNett wrote:
> Paul McNary wrote:
>> Hello
>>
>> I have set up a 1 to many form.
>> The 1 being input fields and the many being an updatable grid.
>>
>> I have a Parent biz object and a child biz object.
>>
>> The bizObj logic creates the new grid record and I enter data in it.
>>
>> I then hit a Save button that does a self.Form.save()
>>
>> That saves the one part of the record but not the many part that is in
>> the grid.
>
> self.Form.save() will call the PrimaryBizobj's save() method. That
> bizobj will, as part of saving the record, call saveAll() on any child
> bizobjs.
>
> So, it sounds like you don't have the child set as such, with a:
>
> primaryBiz.addChild(childBizobj)
>
> call
>
> Paul
>
>
>
The following is my code setting up the form's Biz Objects.
Paul McNary
[EMAIL PROTECTED]
----------------------------------------------------------------
def createBizobjs(self):
class Publiccmpd_HdrBizobj(dabo.biz.dBizobj):
def afterInit(self):
self.DataSource = "public.cmpd_hdr"
self.KeyField = "compoundid"
self.addFrom("public.cmpd_hdr")
self.addField("compoundshortdescription")
self.addField("pkid")
self.addField("compoundid")
self.addField("notes")
self.NewChildOnNew = True
self.RequeryChildOnSave = True
def validateRecord(self):
"""Returning anything other than an empty string from
this method will prevent the data from being saved.
"""
ret = ""
# Add your business rules here.
return ret
class Publiccmpd_IngredientsBizobj(dabo.biz.dBizobj):
def afterInit(self):
self.DataSource = "public.cmpd_ingredients"
self.KeyField = "pkid"
self.addFrom("public.cmpd_ingredients")
self.addField("itemcompoundid")
self.addField("pkid")
self.addField("itemsequence")
self.addField("itemid")
self.addField("itemidtype")
self.addField("itemqty")
self.addField("itemqtyunit")
self.addField("itemdescription")
self.LinkField = "itemcompoundid"
self.ParentLinkField = "compoundid"
self.FillLinkFromParent = True
self.NewRecordOnNewParent = True
def validateRecord(self):
"""Returning anything other than an empty string from
this method will prevent the data from being saved.
"""
ret = ""
# Add your business rules here.
return ret
self.Application.addConnectFile("medispan.cnxml")
self.Connection = self.Application.getConnectionByName("Medispan")
publiccmpd_hdrBizobj = Publiccmpd_HdrBizobj(self.Connection)
self.addBizobj(publiccmpd_hdrBizobj)
publiccmpd_ingredientsBizobj =
Publiccmpd_IngredientsBizobj(self.Connection)
self.addBizobj(publiccmpd_ingredientsBizobj)
publiccmpd_hdrBizobj.addChild(publiccmpd_ingredientsBizobj)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]