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

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

Recommended Posts

Posted

hi everyone....please help me in a situation:

how i can remove browse mode from a field through script.?

Posted

Could you explain what you're trying to accomplish?

I ask because you don't need a script to prevent someone from entering a field in Browse mode. It's a setting you can choose in the Inspector.

Posted

Actually scenario is:

we are entering the detail information of a company and an individual. when any body choose company through checkbox, then the fields regarding information of an individual should become non-editable.

such as:

Name: --n/a--

Posted

There are a few ways you might accomplish that, none I would call extremely elegant. One way that wouldn't be too unreasonable is to make a tab object with 2 tabs. Give each tab an object name using the inspector, e.g. "edit" and "locked". On one tab, place the editable fields, and on the other place a copy of the fields, and use the inspector to disable entry in browse mode as David suggests.

You can then hide the tabs by setting their label and line width to zero. Now create a script that goes to the appropriate tab based on the company checkbox, and set it as a script trigger on that field.

Posted

I'd probably go with an OnFieldEntry script trigger.

I have a generic one I can use on all fields. This is the basic script:

Commit ( locked )

# This script will commit a record when the parameter is true.

Allow User Abort [ Off ]

If [Get ( ScriptParameter)]

Commit Record[]

End If

Assign that script to an OnObjectEntry trigger and pass a parameter that's testing whether a company has been chosen ( i.e. not isEmpty ( _fk Company ID ) ).

That's stop the entry. If you want some indicator of whether it's editable, I'd use conditional formatting to make the field fill gray based on the same criteria you're passing to the script.

Posted

This is what I do as well, David, except I use Go To Object [ dummy ] where dummy is any text object. We frequently use text objects for declaring variables and they ride at the top of layouts and only display in layout mode using conditional formatting: Get ( WindowMode ) < 4 with font set to 500.

I prefer Go To Object [ dummy ] because it does not commit the record. Go to dummy works for other occasions as well. :^)

Posted

Nice solution, David -- and you can apply the script trigger to multiple fields at once.

I agree with LaRetta, I wouldn't necessarily commit the record.

This topic is 4861 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.