disablefieldediting
NAMES

The disablefieldediting statement disables editing for a specified list of database fields (all others are enabled).


Parameters

This statement has one parameter:

names – is a carriage return separated list of field names to disable.


Description

This statement disables editing for the specified list of database fields. Any fields not included in the list will be enabled. This example disables editing for the Price and Discount fields, while enabling editing for all other fields.

disablefieldediting commatocr("Price,Discount")

The Price and Discount fields will be disabled in the data sheet, and also in any forms where the Disabled Fields mirror Data Sheet option has been checked (see Disable Editing of Individual Fields).

A quick way to disable all fields is to use the info(“fields”) function.

disablefieldediting info("fields")

Conversly, to enable all fields, just use "" (an empty list of fields).

disablefieldediting ""

The disablefieldediting statement always affects editing of data in the data sheet. It doesn’t usually affect editing of data in form windows, but if you check the Disabled Fields mirror Data Sheet option in the Form Properties panel, the disablefieldediting statement will also enable and disable editing of fields in that form. See Disable Editing of Individual Fields to learn more about this option.

Note: Panorama 6 had a similar statement, called lockfields. In fact, Panorama X treats lockfields as a synonym for disablefieldediting, so if you have old code with this statement, it will still work. For example, you can lock all fields with this line of code.

lockfields info("fields")

However, there are some important differences from Panorama 6 that you need to keep in mind. The old lockfields statement allowed a second parameter that specified whether the effects were permanent. This parameter is no longer allowed, instead, the disabled field settings are always permanent. Also, the old lockfield statement would have to be re-run if any fields were inserted into or removed from the database, otherwise the wrong fields might be disabled. This is no longer the case.


See Also


History

VersionStatusNotes
10.2NewNew in this version.