Submitted by Armando on 2011/11/01 13:44
There are 2 rather important bugs plaguing conditional column equations.
 
1- First one erases the data in the fields that include a conditional equation/function and no row equation
 
In a sample dB, "invoice" grid :
- In the field management dialog "total" field, remove the row equation
- back to the grid : check or uncheck the "billable" field : total values disappear and... it shouldn't
 
EDIT : forgot to add the workaround. If there's no equation in the row equation section of that field, just add a  "=[that field] " in the row equation section. (replace "that field" with the name of your field in which you implemented the conditional column equation, of course.) This probably hits performance a bit.
 
 
2- Second one : automatic recalculation isn't (re)performed when the condition is "met" or "unmet"
 
- using the invoice grid again : check/uncheck the billable field : nothing gets automatically recalculated at the parent level.
 
EDIT 2011 11 01 -- 14 09 : yet another work around to force recalc in that particular case :
 
In autoassigns of the various conditions add [That Field] = [That Field]
 
E.g.:
A:[the field where there's the conditional column equation] =  [the field where there's the conditional column equation]
E:[the field where there's the conditional column equation] =  [the field where there's the conditional column equation]
 
 
These work around are not ideal, but they work.

Comments

I can confirm both the bugs you describe, the first being the one I reported in http://www.sqlnotes.net/drupal5/index.php?q=node/1084#comment-11390.
 
For the 2nd though the workaround is working for me.
 
I've added the following as you suggest, but check/uncheck of a child's Billable doesn't have any effect on the parent's InvoiceTotal. Instead I have to hit shift-F9 on the parent's InvoiceTotal or check/uncheck the parent's Billable. I'm not sure why the parent's Billable should have any effect since its summarizing from the children?
A: [InvoiceTotal] = [InvoiceTotal]
E: [InvoiceTotal] = [InvoiceTotal]
 
 d

 On what may be a related issue,  I have a boolean field called NotesChildren with the following:
 
Auto-Assignment
A: NotesChildren = NotesChildren
M: NotesChildren = NotesChildren
E: NotesChildren = NotesChildren 
 
Row Equation
NotesChildren
 
Column Equation
AnyTrue(
 
And a user code of
Function AnyTrue(x)
  dim d, i
 
  AnyTrue = false
  d=ubound(x)
  for i=0 to d
      if x(i)=true then AnyTrue =true
  next
end Function
 
 
With the above if I mark a child yes the parent will update to yes. If I then uncheck that child the parent stays yes until I explicitly shift-f9 on the parent. So it picks up changes to yes, but not changes to no.

Both of these issues are fixed in v0.9.25W3