A relatively new functional feature of 1C, related to cloud technologies. After the functionality appeared, the 1C company modified the BSP. The same improvements were included in standard configurations based on BSP, for example, UNF and UT11.

It was necessary to organize the receipt of general reports from several branches with the same configurations. I decided to try the developments from BSP in the field of data separation. The idea was to load each branch's data into its own data area and generate reports for all areas at once. I’ll say right away that it has not yet been possible to solve the problem, but the very attempt to solve it revealed problems and dubious functionality in the BSP.

Attached to the article is a processing that displays the hidden functionality of operations with data areas on a separate form.

The BSP provides two accounting separators: Data Area Main Data and Data Area Auxiliary Data. It remains a mystery why these 2 delimiters refer to the same session parameters: DataAreaValue, DataAreaUse.

Turning on the mechanism

If your self-written configuration is based on the BSP, then most likely, before turning it on, you need to implement the mysterious library “1C: Service Technology Library”. It’s strange that even Google doesn’t know about such a 1C product. And in typical configurations, the Check Possibility of Using Configuration in the Service Model procedure in the Work In Service Model module does not exist. Most likely, you can find the missing parts from this library in standard configurations made on the basis of the BSP. In particular, one of the subsystems is called StandardSubsystems > WorkInServiceModel > UploadLoadData.

The data separation mechanism is enabled by setting the Use Separation By Data Areas constant. Can be set via the All functions menu item.

Creating Data Region Users

This item is not required if you are using a form to enter the data area. Users are created in configurator mode. One user with administrative rights must have all unset data separators in the Data Splitting tab. For other users, the Data Area separator must be set to Basic Data in the Data Separation tab. This separator must be explicitly specified on the command line when starting 1C.

Launching 1C with a command line parameter

This item is not required if you are using the login form to enter the data area.

1C can be launched immediately in data separation mode. The /Z command line option is provided. For example, the parameter “/Z-,+1” indicates that 1C is launched with the Data Area main data value equal to 1, the Data Area auxiliary data separator is not set.

The method is very unreliable. When starting, an error occurs in the WorkInServiceModel procedure. When checking to enable Safe Data Sharing Mode. I couldn't find anything better than to comment on this procedure. The procedure checks whether the user has the right to change the current data area, whether his rights are limited and has security implications.

Then, upon startup, several errors occur, including: “Separated users cannot be assigned the System Administrator role,” “Separated users cannot be assigned the role Running a thick client.”

The user was not found in the Users directory - the problem could not be resolved. In the traditional scenario, the User registers upon first login. I suspect that when sharing data, Users are created through another 1C Fresh application.

Fill in the information register Data areas

For each area, you need to fill out an entry in the Data Area information register, assigning numbers to the areas and the “In Use” status. Processes can check for entries in this register before starting execution.

Entering the data area

Administration - Service - Login to the data area (GeneralForm.LoginDataArea)

Allows the user to change the current data area. Logging into the area is possible as a user running without specifying delimiters. When changing a data area, checks its status in the information register of the Data Area.

Uploading data from an area

The current area is unloaded through the GeneralForm. Uploading Data. Before using it, you must log in to the desired data area. The form is not displayed in the user interface in the Administration section.

The data is serialized by the configuration into XML format and packed in ZIP. That is, archiving does not take place using the 1C configurator, like traditional uploading.

Load data into area

GeneralCommand.LoadDataArea

To appear in Administration-Service, you need to set visibility through the Configurator as part of the Settings and Administration subsystem.

Data is loaded into the selected area. Before this, they must be downloaded into XML format.

conclusions

The system could not be started by specifying delimiters on the command line. The system refused to work due to an unregistered user in the Users directory. It was not possible to get to the directory because the system does not allow users with administrative rights. I think that this scenario requires a mandatory connection with 1CFresh.

Experiments with entering different areas, unloading and loading areas were successful. An attempt to complete a get all organizations request for all data areas failed. Error: "You cannot use a table without specifying all delimiters with independent use of shared data." The report works for one area if you enter any area.

The problem that remains unclear is how to unload data from a database without delimiters into a specific data area of ​​another database.

It would be interesting to know about the cunning idea of ​​the authors of the BSP regarding general parameters sessions for two separators, if the call is with the parameters: “/Z-,+1”, “/Z+1,+1” and “/Z+1,-”.

[Button 7710967300 BUKH RB] Connect=Srvr="%servername%";Ref="%base_name%"; AdditionalParameters=/Z "-0,-0,+7710967300";

After /Z we indicate the general details in order. Since our standard accounting already has two general system details, we specify the value -0 for them so that they are not used, and we pass the TIN as the third one (which we created).

1000 and 1 checkbox

Now you need to determine what part of the data will be common to all areas. All this is configured through the configurator. In the properties of the general props that we just created, there is a “Composition” item that opens a small list of 800 parameters:

We leave the selection of parameters to your prudence, discretion and environment. Here is our version (careful, there are 20,000 pixels).

The separator also makes it possible to set up a separate list of users for each database - this can be useful if you have hundreds of users - when entering a specific database, you won’t have to scroll through this list to the point of bloody blisters. We don't use this because we have configured transparent authorization.

Uploading data from current databases

To download data from current databases, we use universal XML exchange. You can’t just take and unload the database, you need to set up the exchange rules, otherwise errors and conflicts may (and will definitely arise) during loading, and the second database simply won’t fit through. Let us remind you that we divide the database areas for each organization and in our case the following exchange rules work. If you decide to use a different separator, you will have to use your brain and checkboxes. The main thing is not to use standard uploading - this will lead to duplication of all predefined records.

Note to the hostess: it is better to upload reference books and documents separately - this way you can avoid unnecessary errors at the time of uploading.

Loading data into a shared database

We launch 1C with the /Z parameter “-0,-0,+%your separator%”, indicating the separator of the organization whose data we are going to load. We launch a universal exchange and feed it the files received during upload: first directories, then documents. We repeat this operation for each base area.

To simplify the task, we perform uploads in bulk, first running a slightly corrected standard processing through command line(/Execute c:\upload.epf). Then we manually upload the resulting files to the divided database.

How to Spend More Time to Spend Less Time

The separation process is not a quick thing. Let us remind you that we now have more than 500 organizations, but in a couple of weeks we managed to divide only 70. However, we know for sure that in six months we will thank our past selves for the work done and a lot of time and effort saved.

Accountants do not notice the transition of organizations from a regular database to a divided one; for them the process is painless. Only admins have their butts on fire :)

Side effects: space savings of 1 in 20, indirect increase in speed - invaluable. In absolute numbers: 50 organizations occupy 2 GB of space in SQL, while one individual database takes up 800 MB.

The promised fly in the ointment, even four:

  • if one of the users messes up data in one organization, you have to roll back the entire divided database - you can’t just roll back one area of ​​data
  • updates have to be tested more thoroughly, especially those that add or change directories
  • if you need to transfer the database to the client (or merge the tax office:), you have to do the reverse procedure: unload the organization from the divided database using a universal exchange, then load it into an empty regular database and save it to. dt file
  • in a split database, you cannot manage routine tasks (for example, it will not be possible to automatically update exchange rates)
The first three spoons are not so bitter - they just force us to be more attentive. But we don’t yet know what to do with the fourth, but we are diligently researching.

Attention! This is an introductory version of the lesson, the materials of which may be incomplete.

Login to the site as a student

Log in as a student to access school materials

Internal programming language 1C 8.3 for beginner programmers: format in 1C

When programming in 1C, you often have to display (in the same reports) values various types(strings, dates, numbers...). Each of the values ​​has different representations.

For example, the same date "01/01/2005" can be represented as a string as:

  1. "01.01.2005"
  2. "January 1, 2005"
  3. "01.01.05"

These are all string representations of the same value, d For the formation of which a special function is used in 1C Format.

Using the Format function in 1C

Disable grouping of digits

Let's say we need to output the number 10000.

If we write:

A format string generally consists of two parts separated by an equal sign. To the left of equal is the name of the parameter being set (look in the help or examples), and to the right is the value of this parameter.

In the example above, the format string "HH=0" has the HH parameter and the value 0. This combination cancels the grouping of the digits of the number. And, as you can see, 10000 is now output.

Output leading zeros

Another common task is to print leading zeros before a digit. For example, let’s say you want to display the number 5 with a leading zero, that is, in the form “05”:

Report(Format(5, "CHZ=2; CHVN=" ) ) ; // outputs 05

Let's look at the format string "CC=2; CHVN=". It consists of two format strings separated by a semicolon. Let's look at each of them separately.

The string "CC=2" specifies the total number of decimal places displayed, both integer and fractional parts. Thus, the total number of positions that the number will occupy during output will be equal to 2.

The line "ChVN=", as follows from the help, indicates to the function the format that if the number does not reach the declared length (as in our case, because we indicated 2 positions, and 5 occupies only one), then leading zeros should be used. The peculiarity of this format string is that it only has the parameter name and an equal sign, but has no value. You are reading a trial version of the lesson, full lessons are available.

The combination of two format strings gives the result we need, “05”, instead of “5”.

Changing the separator between the integer and fractional parts

Let's assume we need to display fractional numbers separated by an asterisk instead of a dot. That is, so that 25.46 is output as "25*46":

The format string is the DF parameter and the value dddd, which indicates the functions Format print a long representation of the day of the week (notice how many "d"s it contains).

Date month representation

The description of the month by date is displayed as follows:

Report(Format("20050101" , "DF=MMMM" ) ) ; // will print January

The format string has the same DF parameter as in the previous case. But the meaning is different. Now it is equal to MMMM.

Take the test

Start test

1. Format("19050505", "DF=MMMM") will return

2. Format string changing the fractional and integer separator to ^

3. In order for the Format function to return “00005” instead of 5, a format string is suitable

4. In order for the Format function to return “10000” instead of 10,000, a format string is suitable

5. The Format function returns a value of type

What will you learn from this article?

  • The article discusses the purpose of the totals separation mode
  • The behavior of the 1C:Enterprise 8 system during parallel operation of a large number of users is analyzed.
  • Shows the disadvantages of the split totals mode
  • Recommendations are given on the correct use of division of register totals

The 1C:Enterprise 8 platform contains capabilities and mechanisms, the operation of which not everyone has a complete understanding of, as well as how to use them effectively. This is the totals separation mode.

The mechanism for dividing the totals performs a very important and useful function: its use makes it possible to carry out parallel entries in accounting registers and accumulation registers.

Let's show the effectiveness this mode using an example. To do this, consider the situation before and after turning on the totals separation mode.

Before enabling split totals mode

We have two identical documents with numbers 001 and 002:

Both documents move through the accumulation register. There is no control over residues. Accumulation register structure:

Two users, working in their documents, begin to conduct simultaneous work. A situation arises in which two documents of the same type try to make movements at the same time.

In this case, the following picture appears at the DBMS level:

Here's what happens in the system:

  1. Documents are trying to make an entry in the accumulation register
  2. At the DBMS level, the accumulation register is represented by two tables: a table of movements and a table of balances (totals table).
  3. In the movement table, documents can record their data in parallel. This is ensured by different values ​​of the “Registrar” field, and, accordingly, work is done with different rows of the table.
  4. But in the table of balances there is no “Registrator” field; the data in this table is stored in the context of dimensions of the register itself.
  5. Here we observe a situation in which two documents need to change one record, but one record cannot be changed at the same time.
  6. In order not to lose the recorded data, one of the documents must wait its turn to record until the other document records its movements. And, after the first of the documents makes its movements, the second will be able to make its own.

As a result, we observe a loss of time - the second user is forced to wait for the first user to finish processing the document. On the one hand, everything is correct and logical, on the other hand, the parallelism of user work in the system suffers.

To resolve the problem that arose, a mechanism for dividing the results was created.

Its use is intended only for accumulation registers and accounting registers.

Enabling split totals mode

Enabling this mode is quite simple:

Note that the totals separation mode is enabled by default for all created accumulation and accounting registers. In addition to the Configurator in user mode we can see which registers are enabled to use the mode:

What happens after you turn on the split totals mode?

A new column “Separator” appears in the accumulation/accounting register totals table. In the DBMS itself it is called “Splitter”.

In this case, the table of movements remains unchanged; the separator in it is “Recorder”. We see the change in the summary table.

This field is only populated when two (or more) transactions attempt to change the same row in the totals table. When such a case occurs, the "Delimiter" field stores different meanings for each of the transactions.

This implementation of the totals separation mode makes it possible to perform parallel recording of all transactions.

In our example with two documents, when the mode is turned on, the following is observed:

Both of our documents recorded their data in parallel thanks to the new Delimiter field. As a result, there are no waits for locks and increased user concurrency.

Disadvantages of the split totals mode

When this mode is enabled, the size of the register totals table increases due to the fact that a new field has been added, and several rows appear for a set of dimensions instead of one.

When receiving register balances, there is a need to collate the data, which leads to a waste of time, albeit insignificant.

In our case, with two documents to obtain the balance of the “Table” product for the “Main” warehouse, it becomes necessary to add two lines to obtain the final value “7”. When the separator is turned off, row grouping (addition) is not required.

When should you use split total mode?

To do this, you must meet the following conditions:

  1. There is no control of balances by register - there is no reading of data in the transaction. As a rule, there is no control over balances in accounting registers. But if residual control is present, then we will not get any performance gain. In addition, when monitoring balances, you need to use the “LockForChange” record set property, since there is a possibility of deadlock.
  2. Parallel work by users is performed with the register, and active work at that.

When working sequentially with a register or working with a small number of users, there is no point in enabling the split totals mode: the absence of competing transactions does not lead to waits on locks, and, accordingly, there is no effect from using the split totals mode.

Burmistrov Andrey

The shape editor is used to create and edit object shapes application solution. Object shapes are used by the system to visually display object data as the user works.

Any form represents a combination of three components:

  • form dialog - a window that will be displayed on the screen;
  • form module - a program in a built-in language responsible for working with form controls and processing events;
  • form details - a set of objects belonging to the form, the data of which it uses in its work.

The form editor itself provides editing of the form dialogue, its details and calls the text and module editor to edit the form module.

The form editor window contains three tabs that allow editing of all three components of the form.

Editing a Form Dialog

The form editor allows the developer to take full advantage of a wide range of dialog capabilities. Let's list the main ones:

Panels, pages, bookmarks

The dialog editor allows the developer to place special controls on the form that help give the form its own recognizable style, make access to data simple and clear, and also fit a large amount of information into a limited area.

The editor allows you to place several panels on a form, each of which can contain several pages. For example, a document form may contain a panel with two pages: Products and Additional:

The developer has the ability to set a mode in which pages will scroll within the panel, or use bookmarks to switch between pages. The editor allows you to define a large number of different options for the location and display of bookmarks:

For example, bookmarks can be placed horizontally on top:

Or you can arrange the bookmarks on the left vertically:

Controls

The editor allows you to place a large number of different controls on the form. You can place controls by dragging or using a special dialog for inserting controls, which allows you to simultaneously set the desired properties of the selected control:

In the case where the form contains a large number of controls, the developer can use the mode of displaying controls in a list, which allows you to quickly navigate to the desired control:

The editor provides the ability to specify the order in which the user will bypass the form controls when entering and editing data. Installation possible automatic order traversal or manually specifying the traversal order in a special list of controls, or by clicking directly on the form:

Grid, alignment

The Form Editor has great capabilities for controlling the placement of elements on the form. In particular, it supports grid layout, where the borders and sizes of controls are aligned to the layout grid located on the form. The developer has the opportunity to change the pitch of the marking grid and thereby achieve a more precise location of the controls:

The editor also supports the use of alignment lines, which serve to facilitate the alignment and relative position of form controls. For example, in the following illustration, alignment lines are used to position controls on the More page:

The developer has the ability to place the required number of horizontal or vertical alignment lines on the page, as well as use invisible alignment lines. The editor creates invisible alignment lines automatically after two or more controls are aligned along any of the boundaries. For example, if two fields of the same size were left aligned, an invisible alignment line will be created along the right aligned borders of those fields.

Alignment of controls can also be done using special markers indicating the desired direction of movement of the controls. Markers appear when two controls are in close proximity to each other.

Blue alignment handles indicate the desired direction to move the control to align it with one of the boundaries neighboring element controls:

The red alignment handles indicate the desired direction to move the control when it overlaps another control:

It should also be said that the editor supports alignment, resizing and ordering operations for a group of controls:

Bindings

The form editor allows you to customize the behavior of controls located in the form, so that when changing the size of the form, a natural perception of information is ensured: one part of the elements remains in place, the other part moves along with the boundaries of the form, and the third part changes its size in accordance with changing the size of the form.

To specify this behavior of form elements, the developer can describe bindings - the dependence of the position of the borders of the controls on the position of the borders of the form. The border of a control can be snapped to the border or center of a form, or to the border or center of another control.

The editor supports a wide variety various types bindings and can display them graphically:

Separators

The delimiters are special elements controls, with the help of which it is possible to redistribute the space of the form without changing its size. In 1C:Enterprise mode, the separator has the ability to be “grabbed” by the mouse and moved within the form within its limits, taking into account the possibility of the location of other controls and the orientation of the separator:

When you move a separator, all controls bound to the separator will resize or move according to the set anchors:

ActiveX

The editor allows you to place ActiveX controls on a form, which the developer can configure and subsequently manage using the built-in language:

Editing a form module

To edit the form module, the configurator calls the text and module editor. This editor provides the developer with a wide variety of options for creating and modifying module text.

Editing form details

Editing form details is performed in the list, which allows you to create new details, change existing details and delete unnecessary details:

If a form has a main attribute that determines the behavior of the form that differs from the standard one, it is highlighted in bold. The developer can place the cursor on the desired attribute and, using the menu command, immediately go to the form dialog, to the control element that corresponds to the selected attribute.

Additional Information

You can become familiar with using the form editor in real time. To do this, you can download the demo video "Example of developing a trading mini-system", which shows the process of developing a trading mini-system using this editor to create document forms "Receipt invoice", "Expense invoice" and report forms "Sales analysis" and " Sales analysis by period."