Switch
The switch. One setting, two states, and a boolean value stored as is. For a binary choice on a form it reads faster than a lone checkbox.
What it is
| Type | fieldToggle |
| Category | form |
| Children allowed | 0 |
| Styling targets | bspk, input, label |
| Events | onChange |
The settings
Only the settings specific to this block are listed here. The block name, HTML id, anchor, conditional display and repetition are shared by every block and described once, under Shared settings.
Parameters
| Setting | How it is set | What it does | Specifics |
4D code for the field name
vb_Use4dCode | toggle (boolean) | The field name is a 4D expression evaluated at render time: its result becomes the field name sent with the form | default: no |
Field name
vt_FieldName | text (text) | — | required |
Label & texts
| Setting | How it is set | What it does | Specifics |
Right
vb_RevertLabel | toggle (boolean) | — | default: no |
4D code for label
vb_Use4dCodeForLabel | toggle (boolean) | — | default: no |
Field label
vt_FieldLabel | text (text) | — | translatable |
Input & behavior
| Setting | How it is set | What it does | Specifics |
Display like a checkbox
vb_DisplayLikeCheckbox | toggle (boolean) | — | default: no |
Show unchecked when disabled
vb_FalseWhenDisabled | toggle (boolean) | A setting with no effect must not look active: it would suggest a behaviour that never happens. The stored value is left untouched. | default: no |
Is linked to the module entity?
vb_isLinkedToModuleEntity | toggle (boolean) | — | default: no |
Relationship path
vt_HowGetPk | text (text) | Path from the page entity to the one actually holding the value — e.g. Entity.MyCustomer. Left empty, the value is read on the page entity. | |
Disabling condition
vt_QueryDisabled | text (text) | 4D formula: when true, the toggle is greyed out and cannot be changed. Use it to neutralise a setting that depends on another one. | accepts 4D |
4D value
vt_Value | text (text) | — | accepts 4D |
Validation
| Setting | How it is set | What it does | Specifics |
Required field
vb_Required | toggle (boolean) | — | security check, default: no |
Required condition
vt_QueryRequired | text (text) | Only read when the field is already marked required: the expression then decides, on each validation, whether it truly is. Must return a boolean. Skipped on a plain block reload. | |
The tables on this page are produced automatically from the block's schema. If this page and the panel disagree, the schema is right.