Data sharing mechanism 1c. Using a data sharing mechanism instead of RLS. Editing a form module

The 1C separator element is needed to redistribute the form areas as it is convenient for the user at the moment. Almost every Windows user is familiar with using delimiters. Let's say you've created a simple form with two controls.

Traditionally, the items of a list can be located on the left side. In the right part, respectively, there is an expanded detailing of these very items. If the list on the left consists of short names, it is logical to reduce this column to a minimum. Accordingly, in this case, the readability of the right side will increase. Conversely, if there are long titles on the left, the column should be expanded. Dividers allow the user to customize the shape arbitrarily by simply dragging the border with the mouse.

This control method is used when editing tables in Word and Excel. When creating a form, you can create both vertical and horizontal divider form elements. In general, it is most preferable to create shapes that are visually within the screen.

Separator 8.2, 8.3 (managed forms)

You cannot add a separator in managed form 1c, it is added by the program automatically before / after the table field

Data sharing mechanism allows you to store data from several independent organizations in one information base.

This becomes possible due to the fact that common attributes of configuration objects can be used not only as "the same attribute that all objects have", but also as an identifier that the data belongs to one of several independent areas. This can be explained by the following example.

Suppose there is a general attribute "Organization" in the configuration. This means (simplified) that each directory, document or other configuration object will also have the "Organization" attribute.

At the same time, any of the users of the infobase has access to all the data stored in this database, regardless of which organization is indicated, for example, in a particular document.

Now let us indicate that the general attribute "Organization" will be the separator.

Then (simplified) several independent data areas will be created in the infobase, each of which will store data only for one specific organization:

Now, when entering the program, the user will not have access to all the information that is in the information base, but only to the data of his "own" area, in this case to documents, reference books, etc. of his organization.

Another option for using this mechanism is possible, when there are several independent data areas in the infobase and along with this there are data that are available to all program users. For example, they contain a directory of banks, which is the same for all organizations.

In this case, the user has access to "his" data area and to the area of \u200b\u200bnon-shared data, which is common for all users.

The data sharing mechanism is quite flexible and versatile:

  • it allows you to use not one but several separators;
  • there are different modes of using shared data; they differ in how the situation is handled when no delimiter value is specified;
  • the use of a common attribute as a separator can be controlled during program operation from the built-in language without changing the configuration; this is called conditional separation.

In the 1C: Enterprise system, it is possible to maintain accounting for several enterprises in one information base. The accounting separator is used for this.

The use of the accounting separator is specified in the configuration. If the configuration defines the use of the accounting separator, then in the scoreboard it is possible to select a specific value for the accounting separator, according to which accounting totals will be issued.

To set the value of the accounting separator, use the item Accounting separator menu "Actions" or the corresponding button on the toolbar. In this case, a dialog is displayed on the screen for setting the value of the accounting separator.

In field Accounting separator value you can specify a specific value for the accounting separator. How the value is entered depends on the type of accounting separator defined in the configuration. This is usually a reference. In this case, to select a value, use the selection button and select the desired value from the list of values \u200b\u200bin the lookup.

Button "Empty value" allows you to erase the entered value of the accounting separator, that is, to set an empty value. This makes sense if, along with the specific values \u200b\u200bof the accounting separator, an empty value was also used in transactions.

Checkbox "All over" allows you to set the display mode of totals for all values \u200b\u200bof the accounting separator in the amount.

To set the selected values, press the button "OK"... To cancel setting values \u200b\u200b- the button "Cancel".

After setting the selected values, the scoreboard will display totals for a specific value of the accounting separator or for an empty value or for all values \u200b\u200bin the sum, depending on the option selected in the dialog.

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

After / Z, we indicate the general details in order. Since there are already two common system attributes in our typical accounting department, we specify the value -0 for them so that they are not used, and as the third (which we have created) we pass the INN.

1000 and 1 checkbox

Now you need to determine how much of the data will be common for all areas. All this is configured through the configurator. In the properties of the general attribute that we have just created, there is a "Composition" item that opens a small list of 800 parameters:

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

The separator also allows you to set up a separate list of users for each database - this can be useful if you have hundreds of users - when you enter a certain database, you don't have to scrolling through this list to bloody blisters. We are not using this because we have configured transparent authorization.

Unloading data from current databases

To download data from current databases, we use a 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 certainly occur) during loading, and the second database simply won't get through. Recall that we divide the base area for each organization and in our case such exchange rules work. If you decide to use a different separator, you have to use your brains and checkboxes. The main thing is not to use typical unloading - this will lead to duplication of all predefined records.

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

Loading data into a split database

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

To simplify the task, we carry out unloading in bulk, first starting a slightly corrected standard processing via the command line (/ Execute c: \\ unloading.epf). Then we manually upload the resulting files to the split database.

How to spend more time to spend less time

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

Accountants do not notice the transition of organizations from a regular base to a divided one, for them the process is painless. Booty burns only for admins :)

Side effects: space saving 1 in 20, indirect increase in speed of work - invaluable. In absolute numbers: 50 organizations take up 2 GB of SQL space, while one single database takes up 800 MB or more.

The promised fly in the ointment, even four:

  • if one of the users screwed up data in one organization, you have to roll back the entire split database - you can't just take and roll back one data area
  • you have to test updates more thoroughly, especially those that add or change directories
  • if you need to transfer the database to the client (or drain the tax one :), you have to do the opposite procedure: unload the organization from the split database using the universal exchange, then load it into an empty regular database and save it to. dt file
  • it is impossible to manage scheduled tasks in a divided database (for example, it will not be possible to automatically update exchange rates)
The first three spoons are not so bitter - they just make us be more careful. But what to do with the fourth, we do not know yet, but we are diligently investigating.

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

Log in as a student

Log in as a student to access school materials

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

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

For example, one and 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, dfor the formation of which a special function is used in 1C Format.

Using the Format function in 1C

Disable grouping of digits

Suppose we want to output the number 10000.

If we write:

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

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

Displaying leading zeros

It is also a common task to print leading zeros before a digit. For example, suppose you want to display the number 5 with a leading zero in front, that is, in the form "05":

Report (Format (5, "CHT \u003d 2; CHVN \u003d")); // prints 05

Let's take a look at the format string "CHT \u003d 2; CHVN \u003d". It consists of two format lines separated by semicolons. Let's analyze each of them separately.

The line "CHT \u003d 2" sets the total number of displayed decimal places of the whole and fractional parts. Thus, the total number of positions that the number will occupy when displaying will be 2.

The line "ЧВН \u003d", as follows from the help, indicates to the function the format, that if the number does not reach the length declared (as in our case, because we specified 2 positions, and 5 takes only one), then leading zeros should be used. The peculiarity of this format string is that it only has a parameter name and an equal sign, but does not matter. You are reading an introductory version of the lesson, full lessons are found.

The combination of two format strings gives the desired result "05" instead of "5".

Change the separator for integer and fractional parts

Suppose we need to display fractional numbers with an asterisk separator instead of a period. That is, so that 25.46 is displayed as "25 * 46":

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

Date month representation

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

Report (Format ("20050101", "DF \u003d MMMM")); // will display 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 \u003d MMMM") will return

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

3. So that instead of 5 the Format function returns "00005" a format string is suitable

4. So that instead of 10,000 the Format function returns "10000", a format string is suitable

5. The Format function returns a value of the type

Did you like the article? To share with friends: