Locked property

Examples


The Locked property locks a field. The user can’t change the value of a locked field, but they can view data in the field.

Syntax

field.Locked [= boolean]

Parameters

field – A window field object.

boolean – If True, the field is locked and not editable. If False, the field is not locked.

Comments

A locked field appears with a light gray background, indicating that the user can’t change the contents of the field.

You can set the value of a field you’ve locked using VBA. You cannot set the value of a field locked by the accounting system, nor can you unlock a field locked by the accounting system. Typically, Microsoft Dynamics GP application code locks fields whose values are necessary to preserve the integrity of accounting data, such as document totals. You can always return a locked field’s value.

Keep in mind that a locked field is not the same as a disabled field (a field whose Enabled property is False). If False, the Enabled property makes the field non-editable, and also dims the field’s value, prompt and related controls.


Documentation Feedback