November 1, 200718 yr some reports have "control break" structure while some others don't. Is there a way to enumerate dynamicaly in a script all summary fields used in the current layout in a hierarchical way. - - - 8< - - - - - - - - - - - - - - - e.g. SALESMAN: John Smith __MONTH: January ____SALE 1 ____SALE 2 ____SALE 3 __MONTH: February ____SALE 1 ____SALE 2 ____SALE 3 getSummaries() = "Salesman, month" - - - 8< - - - - - - - - - - - - - - - That way, i'll be able to kinda automate sorting on this layout without having to specify "SALE::Salesman ASC, SALE::Month ASC, SALE::DATE" Once more, it's an ACADEMIC example.
November 1, 200718 yr I don't think so. I suppose you could get a list of all summary fields on a layout through a custom function (using FieldNames and FieldType). But the "hierarchy" you speak of is given by the part order - and I don't know of a function that can access that. I any case, even if you had such list, I don't see how you could use it to automate sorting.
November 1, 200718 yr Author Thanks comment... Even if it's not "elegant", i do something like a big "switch case" switch (trim(upper(get(scriptparameter)))) . . case "ID": . . . . Sort Records(Restore; [iD] ASC) . . case "SALESMAN": . . . . Sort Records(Restore; [salesman] ASC) ... ... Till there is no elegant way to sort by a column according to either it's name or it's rank from a calculated field. I think database scheme functions would be a nice addition to FileMaker.
November 1, 200718 yr I guess I don't see the purpose of this. A layout is a pretty static thing. When you change your summary report, change your script at the same time and be done.
Create an account or sign in to comment