So now you have created a small-sized applied solution that automates operations at Jack of All Trades maintenance company. And here comes the change-up pitch.
The staff at Jack of All Trades liked your applied solution so much that they told their neighbors at the Beauty Queen makeup studio about it. The staff at the studio saw how your applied solution works and then asked you to automate their operations as well.
Naturally, you were delighted to accept, for one simple reason: what you have created is a universal configuration, which is suitable for automation of almost any kind of service activities.
All that you need to do to adjust your confuguration for a makeup studio is simply create a new infobase with your configuration and populate it with new data, including employees, new services, and so on. All the accounting tools you have created are not tied to any specific features of a company so they can easily be used in any other company that has similar activities.
So, even if the makeup studio management wants you to add some new functionality, you can do it by editing just a few modules in your configuration. This is much more efficient that recreating an applied solution from scratch for this specific company.
But at the same time a makeup studio might not need some of the features that are already available in your configuration.
So what can you do? Do you have to delete unwanted configuration objects and script?
This can take a lot of time and effort. Real-life configurations can include a large number of configuration objects, which can refer each other in a complex way.
This is why 1C:Enterprise supports the functional options feature. Functional options serve for enabling or disabling functionality blocks during the deployment without changing the configuration itself.
Functional options allow developers to separate some applied solution functionality, so that it can be enabled or disabled during the deployment or at run time.
Suppose that for some reason the makeup studio does not have accounting and payroll calculation. To disable these features, let us create functional options named Accounting and Payroll, assign these options to appropriate configuration objects, and disable them in 1C:Enterprise mode.
So, while the makeup studio has exactly the same configuration as Jack of All Trades, their applied solution does not display any accounting or payroll options, as if they do not exist at all.
In Designer mode
Let us create the functional options.
- Add constants named Accounting and Payroll of the Boolean type (fig. 25.1).
This is where you will store functional option values.
Fig. 25.1. Creating a constant
If a constant value is True, the functional option is enabled. If the value is False, the functional option is disabled.
- In the configuration tree, expand the Common branch, click the Functional options branch, and create functional options named Accounting and Payroll with their respective constants specified in the Data path property (fig. 25.2).
Fig. 25.2. Creating a functional option
Then let us associate configuration objects with functional options.
The following configuration objects are related to accounting:
- ExtraDimensions catalog
- InputOpeningMaterialBalances document
- TrialBalance report
- ExtraDimensionTypes chart of characteristic types
- Main chart of accounts
- Primary accounting register
- In the Payroll functional option configuration object editor, on the Content tab, select these objects (fig. 25.3).
Fig. 25.3. Accounting functional option content
The following configuration objects are related to payroll:
- WorkScheduleTypes catalog
- EmployeeAccruals document
- EmployeeAccruals report
- Recalculation report
- AccrualsChart report
- MainAccruals chart of calculation types
- WorkSchedules information register
- Accruals calculation register
- In the Accounting functional option configuration object editor, on the Content tab, select these objects.
Now if you open the configuration object editor for the ExtraDimension catalog or for any other configuration object that belongs to the Accounting functional option, you can see that the functional option is selected on the Functional options tab (fig. 25.4).
Fig. 25.4. Functional option value for an accounting object
So configuration objects are displayed in the applied solution interface if their respective functional options are enabled (the appropriate constants are True).
And for objects related to payroll you can see that the Payroll functional option is selected on the Functional options tab of the object editors.
The rest of the configuration objects do not have any items selected on the Functional options tab. If a functional option is disabled for an object, this object does not depend on the value of this functional option and is always displayed (fig. 25.5).
Fig. 25.5. Functional option settings for independent objects
Note. If you include a subsystem into a functional option, you will not see the respective section in 1C:Enterprise mode at all when this functional option is disabled.
- Expand the Common forms branch and open the common constants form.
It is the GeneralSettings form that you created in the previous lesson. Currently it contains the NumberingPrefix constant.
Now you need to add the new constants to this form to be able to change the functional option values at run time.
- In the GeneralSettings form, on the Attributes tab, expand the main ConstantsSet attribute and drag the Accounting and Payroll constants to the form controls pane (fig. 25.6).
Fig. 25.6. Editing common constants form
In 1C:Enterprise mode
Let us test the functional options.
- Start 1C:Enterprise in the debug mode.
- In the Quick menu section, click General settings.
This opens the constants form and you can see that both constants are False (fig. 25.7).
Fig. 25.7. Constants form
It means that the respective functional options are disabled.
True, you can see that the commands related to accounting and payroll are missing from the Accounting and Payroll sections (fig. 25.8).
Fig. 25.8. Payroll section interface
So if after a while the management of the makeup studio decides to start using payroll, their administrator will simply enable the Payroll option (fig. 25.9).
Fig. 25.9. Changing the value of the Payroll functional option
- In the General settings form, enable the Payroll accounting option, and then restart 1C:Enterprise.
The restart is required to display the new applied solution interface.
After the restart the Payroll section should look as shown in fig. 25.10.
Fig. 25.10. Payroll section interface
And if you enable the Accounting functional option as well, this restores the applied solution interface initially developed for Jack of All Trades.
This is how an applied solution can be quickly and easily customized in compliance with customer requirements.