First, let us add subsystems to the functional options.
- Open Accounting functional option content and add the Accounting subsystem.
- Open Payroll functional option content and add the Payroll subsystem (fig. 25.11).
Fig. 25. 11. Payroll functional option content
Now let us proceed to creating a new functional option. You need a constant to store the option value.
- Add a constant named AccountingByCustomers of Boolean type (fig. 25.12).
Fig. 25.12. AccountingByCustomers constant
- Add a functional option named AccountingByCustomers and specify that its value is stored in the AccountingByCustomers constant (fig. 25.13).
Fig. 25.13. AccountingByCustomers functional option
- On the Content tab, specify the objects to be included in the functional option (fig. 25.14):
- Customers catalog
- Customer attribute of the Services document
- Customer dimension of the Sales accumulation register
Fig. 25.14. AccountingByCustomers functional option content
Let us update the GeneralSettings common form that is used to specify functional option values.
- In the GeneralSettings form editor, drag the AccountingByCustomers constant to the form controls (fig. 25.15).
Fig. 25.15. GeneralSettings form
Next you have to ensure that the applied solution interface is refreshed when new functional option values are applied.
- In the form controls tree, double-click the root Form item.
- In the property palette, find the After write at client event and click the Open button in that field.
- Specify that the handler is only executed on the client.
- In the form module that is opened, add a single line to the handler body, as shown in listing 25.1.
Listing 25.1. AfterWrite form event handler
&AtClient Procedure AfterWrite(WriteParameters) RefreshInterface(); EndProcedureRefreshInterface() is a global context method that refreshes the command interface, the home page, and opened forms according to the current functional option values and their parameters.
To simplify testing the functional options, let us modify the common form so that it does not block the main applied solution window.
Currently, when you open the GeneralSettings form in 1C:Enterprise mode, you cannot change anything in the main applied solution window because it is blocked while the General Settings form is open. This happens because the form wizard selected the default Lock parent window value for the Window open mode property.
- Click the Form tab and then, in the form controls tree, double-click the root Form item.
- In the property palette, set Window open mode to Independent (fig. 25.16).
Fig. 25.16. Window open mode property