Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi to all friends,

it's possible to get the calculation of a given calculated field ?

Thanks to all

GetField() or Evaluate() are functions that you might want to look into.

Dana

  • 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) ?

What's the purpose? Can't you just look at the calc definition?

  • Author

Hi, Ender

and what is the purpose of:

FieldComment ( fileName ; fieldName )

You can just look at field definition !! wink.gif

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 !!!

Unless you made the Field Comment equal to the calculation's definition, I do not believe there is a way to retrieve that data.

  • Author

Hi Queue

yes, so I think too.

But that data is there ... and I can't get it !!

You mean you cannot retrieve the Field Comment using the FieldComment function?

  • 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 ) !!!

As I said, there is no such function unless you put the definition in the Field Comment.

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

]

You Mac people are always rubbing it in. wink.gif

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?

For cross platform solutions, I do this:

If [abs(Get(SystemPlatform))=1]

# Do mac stuff here

Else

# Do PC stuff here

End If

  • 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 ?

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.

  • 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 !!!

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.