June 3, 200520 yr Hi to all friends, it's possible to get the calculation of a given calculated field ? Thanks to all
June 3, 200520 yr Author Thanks, Reed But I have to explain me better... the calc of cfield is so definited: Get(UserName) and now it's possible to read "Reed". How can I get the calc of cField ? How can I get: Get(UserName) ?
June 3, 200520 yr Author Hi, Ender and what is the purpose of: FieldComment ( fileName ; fieldName ) You can just look at field definition !! BTW I looked for a tip to look at the cField calculation and put that calc into another field, without look at the calc definition, because I like to try all FM possibilities !!!
June 3, 200520 yr Unless you made the Field Comment equal to the calculation's definition, I do not believe there is a way to retrieve that data.
June 3, 200520 yr Author Hi Queue yes, so I think too. But that data is there ... and I can't get it !!
June 4, 200520 yr Author no, I mean that I cannot retrive that data from the DB ! I would like a function (as FieldComment ( fileName ; fieldName )) but in the form: FieldCalc ( fileName ; fieldName ) !!!
June 4, 200520 yr As I said, there is no such function unless you put the definition in the Field Comment.
June 5, 200520 yr Piece of cake on a Mac: Perform Applescript [ tell app "FileMaker Pro" set theformula to formula of field "MyCalcField" of database "MyDbaseName" set cell "gFieldCalcFormulaResult" of current record to theformula end tell ]
June 5, 200520 yr You Mac people are always rubbing it in. That's okay. I'll be xplat very soon and I'll use this Apple script too. Great stuff, Bob. BUT ... what happens if this is executed on a solution running both platforms? Is that okay? Or must it's use to restricted to Mac solutions alone?
June 5, 200520 yr For cross platform solutions, I do this: If [abs(Get(SystemPlatform))=1] # Do mac stuff here Else # Do PC stuff here End If
June 5, 200520 yr Author Hi you said: Perform Applescript [ tell app "FileMaker Pro" set theformula to formula of field "MyCalcField" of database "MyDbaseName" set cell "gFieldCalcFormulaResult" of current record to theformula end tell ] and that works also if the DB is protected ?
June 5, 200520 yr If the Filemaker script in which the applescript is called, is set to run with full access privileges, then it will return the formula regardless of what the current user's access privileges are. If the "run with full access privileges" is left unchecked, and the current user's access privileges do not allow access to field definitions, then it will return an error.
June 5, 200520 yr Author Hi BobWeaver I wish to know if that applescript can look at a calculation of another DB and if Yes, if that applescript works if that DB is protected. That was my fear and that was the reason of this topic !!!
June 6, 200520 yr I haven't tried it in version 7 yet, but I used this technique in version 5 to create automatic documentation of databases. If you look in the sample files forum, you'll find my SoftDoc file there. I expect that if the other database is open with full privileges then you could do it from a remote script, same as in earlier versions, but if the database is open with restricted access, then I don't think you could get the formula. The same is also true of earlier versions.
Create an account or sign in to comment