Scope: a managed application, a mobile application.
1.1. Do not place export procedures and functions in form modules. To implement export procedures and functions, it is recommended that you use object modules, object manager modules, or common modules. To pass input parameters to forms, use the OpenForm method. To get results, use notification handlers (see Opening forms). To interact with opened forms, use the Notify method and the NotificationProcessing event handler (see Updating lists upon interactive user operations).
Form = GetForm("CommonForm.MyForm");
FormParameters = New Structure("RunMode", RunMode)
1.3. Do not call form module export procedures and functions to update form data or programmatically redraw the form as a result of user actions in other forms. In this case, use the Notify global context method, the NotifyWritingNew, NotifyActivate, and NotifyChoice form methods. See also: Updating lists upon interactive user operations.
2. Sometimes, it might be necessary to implement in a form module procedures and functions that are executed both on the client and on the server. For example, to update form data from the OnCreateAtServer server handler and from OnChange client events.
To avoid code duplication, place such procedures and functions in a form module with the &AtClientAtServerWithoutContext compilation directive and pass the context therein independently as a parameter. Either the form itself (ClientApplicationForm) or its attribute (FormDataStructure) can serve as a context.
Form.Items.GoodsAmount.Availability = Form.Object.AllowEditAmount;