On Thursday 13 September 2007 16:50, Ed Leafe wrote:
> On Sep 13, 2007, at 4:00 PM, johnf wrote:
> > I don't understand your code enough to allow me to comment (I still
> > call
> > myself a newbie).
>
>       Try it to see if it works; I can always explain it later.
>
> > But it still appears that a dynamic cursor is required to
> > execute the select statement to determine if additional children
> > exist.  I
> > much prefer not to use a bizobj.
>
>       OK, then add this to the code that the bizobj uses to do its
> calculation:
>
> crs = self.getTempCursor()
> crs.execute("select sum(whateverField) as total from...")
> tot = crs.getFieldVal("total")
>
>       This will get you the total for whatever condition is appropriate
> for the query. If you need to iterate through all the records of the
> bizobj in order to see which have child records, you can create a
> method that will query the children, sum their totals and return the
> total value, and then call it via the dBizobj.scan() method. If you
> make sure to set ScanRestorePosition=True first, when the scan loop
> is done, your bizobj will be back on the same record when you're done.
>
Thanks Ed - I think this is worth looking into.  Larry has not posted his most 
recent code so I'll have to wait to see what he has done.

-- 
John Fabiani


_______________________________________________
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/dabo-users/[EMAIL PROTECTED]

Reply via email to