Form control to switch to FormMode.View mode. Also switches the form from FormMode.New mode to FormMode.Edit mode. Form control to switch to FormMode.New mode. Form control to switch to FormMode.Edit mode. Form control to submit to the data source. Often, the data card's DisplayMode property will be set to Parent.DisplayMode (referencing the form) as will the control's DisplayMode property (referencing the data card): Modeĭata cards and controls are editable, ready to accept changes to a record.ĭata cards and controls are editable, ready to accept a new record.ĭata cards and controls are not editable and optimized for viewing. The mode also determines the value of the DisplayMode property, which can be used by data cards and controls within the form control. The current mode can be read through the Mode property. The SubmitForm and ResetForm functions have no effect when in this mode. In this mode, the contents of the Form control's Item property are used to populate the form. The ViewForm function changes the Form control's mode to FormMode.View. You can also reset individual controls with the Reset function but only from within the form. The OnReset behavior of the form control also runs. If the form is in FormMode.New mode, the form is reset to FormMode.Edit mode. The ResetForm function resets the contents of a form to their initial values, before the user made any changes. If the SubmitForm function runs when the form is in this mode, a record is created, not changed. In this mode, the contents of the Form control's Item property are ignored, and the default values of the Form's DataSource property populate the form. The NewForm function changes the Form control's mode to FormMode.New. When the form is in edit mode and Item is null, data card properties are not evaluated and will return default values. FormMode.Edit is the default for the Form control. If the SubmitForm function runs when the form is in this mode, a record is changed, not created. The EditForm function changes the Form control's mode to FormMode.Edit. If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties are set accordingly.If the form was in FormMode.New mode, it is returned to FormMode.Edit mode. If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties are cleared.If validation passes, SubmitForm submits the change to the data source. If a problem occurs, the data isn't submitted, and the Error and ErrorKind properties of the Form control are set accordingly. SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid properties of the Card controls that the Form control contains. This behavior matches that of the Validate function. ![]() Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a Form control to the data source.īefore submitting any changes, this function checks for validation issues with any field that's marked as required or that has one or more constraints on its value. You can use these functions only in behavior formulas. You can use controls and these functions together to create a complete solution. These functions are often invoked from the OnSelect formula of a Button or Image control so that the user can save edits, abandon edits, or create a record. The form is populated with an existing record but the user cannot modify the values of the fields. ![]() ![]() Once complete, the user can add the record to the data source. The form is populated with default values and the user can modify the values of the fields. Once complete, the user can save the changes to the record. ![]() The form is populated with an existing record and the user can modify the values of the fields. The form control can be in one of these modes: Mode These functions change the state of the Edit form control. View, edit, or create an item, save the contents, and reset the controls in an Edit form control.
0 Comments
Leave a Reply. |