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.

Using a script to give read/write access to a field.

Featured Replies

  • Newbies

Hi there, I have a relatively simple question but I'm horribly inexperienced with FM and scripts in general. As the name suggests, I need to make some fields read only if certain parameters are met. I figure the easiest way to do this is with a script, however, beyond knowing what to write in a pseudo-code way, I'm a bit lost.

 

I figure first I need to make the required field read-only. Then write an if statement that switches on write privileges once the criteria is met. Something like:

 

Set field "sale price" to read only.

IF status = sold

field "sale price" = writable

ELSE

ENDIF

 

How would I do this in FM12?

 

I appreciate any and all help, thanks for reading.

FileMaker fields don't have a writable status on the field level; you can/must set the desired field behaviour of a field object on a layout, which is not possible via script.

 

To achieve the desired effect, write a script along the lines of:

 

If [ myTable::status ≠ "sold" ]

  Commit Record

End If

 

and assign it to the OnObjectEnter trigger for the salePrice field.

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.