Hi, Does anybody know of a way to re-calculate all FlowFields on a record without having to do Rec.CALCFIELDS(FlowField1, FlowField2, FlowField3…) ? I have some code which renames the current record and shuffles some other records around which works great, apart from once the renamed record is retrieved, the FlowFields have not been calculated. I have tried doing CurrForm.UPDATE etc but this has no effect. I have tried using CALCFIELDS on one FlowField and this does the trick - I just don’t want to have to list every FlowField to be re-calculated. Any help appreciated, Jonathan
Jonathan, unfortunately there is no function that updates all the flowfields on a record. I guess mainly due to performance issue and perhaps also due to the limitation of max. 30 flowfields to open a record or table directly. You could try to play around with fieldref’s (run through all the fields of that record, check if they are flowfields and perform the CALCFIELDS) but IMHO this is not worth the effort. Maybe putting the flowfield on your form and make it visible=no might work, though I haven’t tested it. Saludos Nils
It sure would be nice to have Rec.CALCFIELDS("All of them!’) wouldn’t it :). I’m afraid you’re going to have to list all of the ones you need.
But this is kind of thing RecordRef / FieldRef was meant for - to dynamically perform actions at runtime based on meta-data. I think Nils’ suggestions is fine and is what you are after. Sorry, dont have time to get exact syntax, but Pseudo code is: FOR eachField := 1 TO recRef.FIELDCOUNT BEGIN fieldRef := recRef.FIELDINDEX(eachField); IF fieldRef.CLASS = FlowField THEN fieldRef.CALCFIELD(); END END
Thanks Robert, just what I was after.
quote:
But this is kind of thing RecordRef / FieldRef was meant for - to dynamically perform actions at runtime based on meta-data. I think Nils’ suggestions is fine and is what you are after. Sorry, dont have time to get exact syntax, but Pseudo code is: FOR eachField := 1 TO recRef.FIELDCOUNT BEGIN fieldRef := recRef.FIELDINDEX(eachField); IF fieldRef.CLASS = FlowField THEN fieldRef.CALCFIELD(); END END
Originally posted by robertc - 2005 Oct 27 : 19:22:17
Brilliant!!