Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4093 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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.

Posted

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.

This topic is 4093 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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