Scheduled exchange using standard means. Scheduled exchange using standard tools Development of rules for data exchange using the example of modified UT and BP databases

The need for exchange between different configurations has arisen since the advent of 1C version 7.5. Various methods and mechanisms have been developed. The article describes modern (for the 1C:Enterprise 8.2 platform) mechanisms used for exchange between different configurations. The article is intended for novice programmers creating their own exchanges or analyzing standard ones. The description of the exchange procedure uses some utopian idea of ​​exchange, a kind of spherical exchange in a vacuum.

Statement of the data exchange problem

The exchange occurs between two different configurations, let’s call them Source and Receiver. By default, we consider the direction of the exchange to be one-way. The metadata structure of the Source and Destination configurations is different. Some types of documents need to be exchanged regularly.

In general, the two-way exchange problem is divided into two one-way exchange problems, only the source and receiver are swapped.

Difficulties

  1. Documents in the configuration have a different set and composition of details
  2. Some details of composite type documents (directories).
  3. If a document that has already been transferred has been modified by a document in the Source configuration, it must be re-transmitted to the Sink configuration
  4. Duplication of elements is possible if directories were filled out in two databases at the same time. Alternatively, if there are duplicates in the directory (directory elements with the same set of details), an “unnecessary” element will end up in the document - for example, one that has not been used for a long time and is marked for deletion.

Solution methods

Stage 1: Object Matching

To create rules for mapping the details of the Source configuration document into the details of the Receiver configuration documents, exchange rules are created. Exchange rules a special file in XML format that describes the correspondence and rules for converting Source objects into Receiver objects. The creation of exchange rules is automated using the “Data Conversion” configuration. From the Receiver and Source configurations, using special processing, XML files are downloaded that describe the metadata structure of the corresponding configurations and loaded into “Data Conversion”.

When describing the exchange rules, it is necessary to indicate the details (the so-called key details) by which the system will search in the Receiver for objects corresponding to the Source objects.

In modern exchange schemes, matching by details is used only during the initial exchange setup. During the work, the key details of the directories can change, but objects should not lose connection with each other. To do this, the “Matching objects of exchange” register is filled in the Receiver configuration. The register contains: the unique object identifier (GUID) of the Source configuration and the globally unique identifier of the object corresponding to it in the Receiver.

Stage 2. Registering changed objects

In the 1C:Enterprise 8 platform there is a metadata object specifically designed for organizing exchange - Exchange Plan.Exchange plans contain information about nodes that can participate in data exchange, determine the composition of the data that will be exchanged, and indicate whether the distributed information base mechanism should be used during the exchange. In one application solution, there may be several exchange plans, each of which can describe its own data exchange procedure. For example, if data is exchanged with remote warehouses and remote offices, then, most likely, there will be two exchange plans (one for exchange with warehouses, the other for offices), since the composition of the data exchanged with warehouses will be significantly narrower "than the composition of the data intended for exchange with offices.

In its simplest form, the Exchange Plan (which does not use the distributed database mechanism) can be represented as a table with two columns: the identifier of the data receiving node and the identifier of the object intended for uploading. The exchange plan is configured to monitor specific metadata objects. When any metadata object included in the exchange plan is changed, the global identifier of the changed object is included in the exchange plan with the sign of change. After uploading the data, the change flag is reset.

Stage 3. Transport

Data exchange topologies are very bizarre. Both direct access to the Receiver database from the Source and indirect access are possible. In the first case, it is possible to use an ADO connection - a direct connection from the Source to the Receiver. The option is very convenient from a user point of view: having configured the exchange parameters and user authorization in the Receiver once, carry out the exchange with one click of a button (or according to a schedule).


When direct access to the Receiver is not possible, the data is dumped into an intermediate XML file, transferred to the Receiver side and downloaded. It is also possible to use a shared ftp resource.

Before setting up an exchange

Duplicates and objects marked for deletion

Before setting up the exchange, get rid of duplicate elements in directories. Delete objects marked for deletion.

Entering directories and information registers

There must be one source for entering directories and information registers. Then you will get rid of the need to constantly correct incorrectly synchronized elements, due to which seemingly identical movements do not “collapse” in the balance sheet.

Conclusion

As a result, creating an exchange scheme looks like this:
  1. Exchange rules are created in the “Data Conversion” configuration
  2. The exchange plan is created and initialized
  3. Information bases are being prepared for exchange. Removing duplicates
  4. When initializing the exchange, the information register “Correspondence of exchange objects” is filled in
  5. The appropriate transport is selected (direct access, via file)
  6. Regular data exchange takes place

Bibliography

P.S. Constructive criticism and additions are welcome.

Data exchange between the 1C ZUP 8.3 program and Accounting 8.3 is necessary to reflect transactions for settlements with employees in accounting. If you keep personnel records and calculate salaries in the 1C ZUP 8.3 program, then read here how to download data from 1C ZUP 8.3 to 1C Accounting 8.3.

With a small number of employees, personnel records and payroll calculations can be carried out in the accounting program 1C 8.3 Accounting. But if your organization has a need for larger-scale and detailed accounting of salaries and personnel, then for this you will need the additional program 1C 8.3 Salaries and personnel management. Keeping records in two programs is not very convenient, but 1C solved this problem. Now the exchange of data between 1C 8.3 databases from ZUP 3.1 to Accounting 3.0 occurs automatically. But for this you need to configure the synchronization of 1C 8.3 Accounting and ZUP. How to do this yourself, without involving technical specialists, read in this article. How to set up data exchange between 1C 8.3 databases from ZUP 3.1 to accounting 3.0 in a few steps, see below.

Step 1. Set up synchronization in 1C ZUP 3.1

Go to 1C ZUP 8.3 in the “Administration” section (1) and click on the “Data synchronization” link (2). A window for setting up the exchange will open.

In the window that opens, check the box next to “Data synchronization” (3) and click on the “Data synchronization settings” link (4). The settings window will open.

In the window that opens, click the “Set up data synchronization” button (5) and click on the link “Enterprise accounting, edition 3...” (6). A window will open to continue setting up.

In the new window, select “Specify settings manually” (7) and click the “Next” button (8). A window will open for you to fill in the exchange parameters.

In the window that opens, you need to specify some system exchange parameters. First you need to select a connection option in another program. In our example, this is “Direct connection to a program on this computer...” (9). This method is used if the 1C 8.3 Accounting program is located on the same computer or on the same local network with 1C 8.3 ZUP. Next, you need to specify the connection parameters in another program. In our example, there are two possible options:

  1. On this computer or on a computer on the local network
  2. On the 1C:Enterprise server

In our example, we select the second option (10) and fill in the “Server cluster” (11) and “Infobase name” (12) fields. Read where to get the data for these fields in the next step (Step 2).

Next, select “1C:Enterprise Authentication” (13) and enter the user (14) and password (15) that you use to log into 1C 8.3 Accounting. The data has been entered, now check the connection by clicking on the “Check…” button (16). If the test is successful, after a while the message “Connection test completed successfully” will appear. If something goes wrong, you will see an error message with a brief description of the problem.

In the next step we will tell you where to get the data on the server cluster and database name, and in the third step we will return to setting up synchronization.

Step 2. Where in 1C 8.3 to get data on the cluster and infobase name

When you log into 1C you see the launch menu. In this menu, click once on the database with which you are setting up synchronization, on 1C 8.3 Accounting (1). Next, click the “Change” button (2). The database editing window will open.

In this window you see data on the server cluster (3) and the infobase name (4).

Now let's get back to setting up synchronization.

Step 3. Continue setting up synchronization in 1C ZUP 3.1

In the first step we stopped at checking the connection. If everything went well, click the “Next” button (1). A window will open for further synchronization settings.

In the new window you see rules (2) for uploading data from 1C ZUP to 1C Accounting. To change these settings, click on the “Change” link (3). The exchange rules setting will open.

In this window, you can specify the start date of the exchange (4), select organizations for exchange (5). You can also choose the method for generating transactions in 1C 8.3 Accounting:

  • “with details by employee” (6);
  • “summary by employees” (7).

To save the settings, click the “Save and close” button (8). To move on to the next setting, click “Next” (9). A window for further settings will open.

In this window you see the rules (10) for uploading data from 1C Accounting to 1C ZUP. If necessary, you can change them by analogy with the previous setting by clicking on the “Change” link (11). To continue, click the “Next” button (12). A window will open with general information on synchronization settings.

If there are no errors, a window will open with a message about successful data synchronization (15). The program will prompt you to synchronize by default (16). To do this, click the “Next” button (17). A window will open with data matching information.

In the new window you can see directories for which there is unsynchronized data (18). Since you will be synchronizing information from two different information bases - 1C ZUP and 1C Accounting - from the date specified in the settings, it is necessary that certain directories in both databases have the same values. Such reference books include, for example, “Individuals”, “Organizations”, “Methods of reflecting salaries in accounting”. In this window you see directories (18) for which the data does not match. The program will automatically create the missing directory elements in both databases. To do this, click the “Next” button (19). The following window will open to synchronize data.

In the window that opens, the program informs you about the composition of the data that will be sent. To view a report that shows a list of this data, click on the link “Composition report...” (20). To complete the exchange, click “Next” (21). The exchange procedure will start, it will take some time.

Once the data exchange is complete, a window will open indicating that synchronization is complete (22). In this window you can configure the so-called “exchange schedule”, i.e. temporary rules according to which data exchange between two databases will automatically take place. To configure these rules, click the “Configure” button (23). The data synchronization script opens.

In the script window, click on the “Set up routine task schedule” icon (24). The exchange schedule setting will open.

In this setting, you can set at your discretion the time interval at which programs should exchange data. For example, in the “Repeat after” field (25) you can set the number of seconds after which the exchange will be repeated. To save the setting, click “OK” (26).

You have successfully configured synchronization between databases and started exchanging data. You can change exchange settings and control the synchronization process in the “Data Synchronization” window. You can enter it through the “Administration” section (27) by clicking on the “Data synchronization” link (28).

How .
Read,

Let's look at a simple real life example. Let's say we have a company that is engaged in wholesale and retail trade, and in this company, like in any other, accounting is done. The enterprise has two standard databases, these are UT (trade management) and BP (accounting of the enterprise), respectively, in each of the databases its own records are kept, in UT there is management to reflect all transactions related to trade, in BP there is accounting. In order not to do double work, i.e. do not create the same documents in two databases (after all, movements should be in management and accounting) we will just set up synchronization between these databases.

We will set up one-way data exchange, from UT ---> BP. It is also possible to set up a two-way exchange, but in practice this is not often required, so we will not consider it in our example.

Preparatory steps for setting up exchange in BP

Let's start setting up synchronization, first go to the 1C "Enterprise Accounting 3.0" database (receiver), we need to check whether synchronization is enabled for this database, in order to do this we need to first go to the database. As soon as the database opens, go to the tab "Administration" ---> "Data synchronization settings"

A new tab opens in front of us; it must be filled out in the same way as in the screenshot below, with the exception of the information base prefix. The prefix must consist of two letters, you can set any, but according to the 1C standard it is better to set the prefix by the name of the configuration, that is, for “Enterprise Accounting” the prefix will be “BP”. If you are setting up complex exchanges and there are several accounting databases, then the prefixes should clearly differ from each other; here you can use the first two letters of the organization’s name as an abbreviation.

We continue setting up data synchronization in UT

After we have done all the necessary actions in the receiver database (BP 3.0), to continue setting up data exchange we need to open the source database (UT 11.1). Go to the "Administration" tab, select "Data synchronization settings" in the menu on the left. If synchronization is not enabled, then enable it using the checkbox, and do not forget to specify the source base prefix. Once we have completed all steps 1-4 as shown in the image below, you need to click on the “Data Synchronization” hyperlink (step 5).

In the new window that appears, you need to click on the green plus sign (Set up data synchronization), in the drop-down menu select the item “Enterprise Accounting 3.0”.

Setting up important points in data exchange between UT and BP

Now we see a window with settings for data synchronization in 1C, select “Specify settings manually” and click “Next”.

We continue to set up data exchange in 1C, on the next tab we need to select the option of connecting to the receiver infobase (direct connection to the program), connection parameters (on this computer or on the local network), the directory where the receiver base is located, as well as the necessary authentication data ( username and password in the database).

On the next page we must fill in the rules for sending and receiving data from the BP 3.0 (receiver) configuration. Click "change data upload rules".

The “Rules for sending data” window has opened in front of us, in it we set the following parameters:

  • Which reference data will be sent (in our example, we are only interested in documents and the reference data used in them, so we selected the appropriate item; if you select the first item “Send all”, then all reference books will be reloaded along with the documents, often if the information is not used in the documents then it is useless for the receiver, because it does not affect the accounting in any way)
  • From what date should all information be sent (we will not consider manual synchronization in this article)
  • To which or which organizations to send data (in our example, we chose one organization, IP "Entrepreneur")
  • Rules for forming contracts
  • Generalized warehouse
  • Should I roll up documents by warehouse?

After we have made the settings, click “Save and close”.

Since in our example we set up and use one-way exchange, from UT to BP, then the settings for the rules for obtaining data from “Enterprise Accounting 3.0” are not of interest to us, so we click “Next”.

In a new window, we are asked to configure rules for the receiver base (RB). In point 1, we name our database, give it a prefix. The PREFIX must be the same as we set it in the BP database itself at the beginning of this article; if the prefixes are different, data synchronization in the 1C program will not work. After that, click point 2, and then point 3.

In paragraph 3, we need to allow documents to be processed when they are loaded into the database. Click "Save and close".

Now the window should look something like the one shown below, click “Next”.

This window contains reference information about the synchronization being created in 1C. Just click the "Next" button. If the program generated an error when setting up data synchronization, then you need to contact us so that our 1C specialist can help you right now!

Next step the program will offer to synchronize immediately after creating the data exchange settings. Let's agree to this and click "Done".

A window will appear in front of you in which you will see information about how the synchronization is proceeding. If the receiver base is not empty, i.e. records have already been kept in it, then the user in the 1C program will be asked to make a comparison of objects manually. Comparison of objects in 1C when synchronizing data is a comparison of identical objects of the receiver with identical objects in the source.

Let's look at an example, let's say in UT there is a counterparty with the name "PharmGroup LLC" and TIN 1234567, and in BP there is also a counterparty with TIN 1234567, but the name "PharmGroup", if we do not compare these two objects when comparing data at the synchronization stage, then after synchronization in the receiver (Enterprise Accounting 3.0), we will have two counterparties with TIN 1234567 and two names “PharmGroup LLC” and “PharmGroup”, respectively. In order to avoid such situations, a mechanism for comparing objects was invented.

In our example, the receiver database is empty, and therefore the object comparison window did not open. But after performing some operations, the system will definitely prompt the user to add some additional data and display the following window. We don’t need to transfer any additional data, we’ve already configured everything we need earlier, so at this step we select “Do not add documents to sending.” Click "Next".

The final stage of data exchange between 1C

At the final stage, the program will display the following window, in which the user will be informed that the synchronization was successful, click “Finish”. At this point, synchronization between databases in a one-way exchange from “Trade Management 11.1” (UT) to “Enterprise Accounting 3.0” (BP) is completed.

Data exchange between 1C databases– the main nuance when working with the information base. Without this procedure, it is impossible to organize full-fledged work. Almost always, an enterprise has separate branches or remote points on the territory of the organization itself. It is necessary to exchange information between them in order to obtain up-to-date information. It's easy if you follow the instructions below.

Data exchange between 1C 8.3 databases: setup instructions

Set up data exchange between 1C 8.3 databases can be done as follows:

  • Go to the 1C program "Enterprise Accounting 3.0" (receiver).
  • Click on " All Functions-Plan-Exchange-Full" Create a peripheral node.
  • Select the directory (which one is needed - network or local) and wait until a notification arrives in the form of a message about the creation of a node.
  • It happens that the item “ All functions" Not available. In this case, you need to go to “ File-Services-Parameters" and install " bird" at the bottom.
  • Having successfully created a node, you need to deliver it to the required location. To do this, go to " Administration».
  • Click on " Setting up data synchronization».
  • Check the box " Data synchronization". Here select " Set up sync. data" and then " Full».
  • Select an exchange directory, you can use ftp or exchange via email. Once the setup is complete, the system will ask you to enter the required prefix. You will also need to perform similar manipulations in the peripheral node. If you need automatic exchange, set the schedule on the thematic tab.

That's all, you have successfully completed the setup.

The initial option for setting up data exchange requires not only programming knowledge, but also consulting knowledge. Sometimes setting up this function turns out to be the most time-consuming and expensive task.

Stages of data exchange, in which one of or all objects are 1C products:

  • The composition of the exchange is agreed upon;
  • The protocol is defined;
  • Synchronization stage;
  • Defining and setting up exchange rules;
  • Schedule.

Stage one: composition of the exchange

The direction of exchange can be one-way or two-way, depending on the role of the objects of exchange. In total, two configurations are involved in the exchange - “source” and “receiver”. In a one-way exchange, data flows from one object to another and their roles do not change. In the case of two-way communication, the roles of the objects are constantly changing and data leaves both objects and also arrives at both objects.

At the same stage, the exchange format is determined:

  • Distributed information security
  • Universal OD.
  • EnterpriseData.

Stage two: exchange protocol

Using 1C:Enterprise 8 you can exchange data of different types and standards. Therefore, in determining the exchange protocol, one should start only from the capabilities of the system with which the exchange will take place.

Stage three: synchronization of directories

The main principle is the presence of one input point.

Stage four: setting the rules

A full display of the received data is possible only if the data exchange rules have been correctly specified and configured.

In order to easily, quickly and correctly cope with this stage, you can use the rule tree. In it you can find all the necessary data for each element of the rules, parameters, algorithms, or through it you can open the main form for setting up the rules.

Stage five: schedule

To automate regular exchange, you should set up periodic data upload.

It is possible that modifications will be required during the work process. The reasons for this may be different:

  • Exchange objects were previously finalized;
  • The database configuration is atypical;
  • Different versions of working platforms;
  • Not current/not updated version of the configuration;
  • It is necessary to change the exchange rules to non-standard ones, etc.

The PPP configuration ("Manufacturing Enterprise Management") in the standard version already contains ready-made data exchange mechanisms. But they also need to be configured. Please note that the exchange of SCP is only possible in newer versions.

Using the “Service” button, select the required data exchange menu. If the program indicates that the exchange option is not available, check the corresponding box in the “Settings” menu.



After this, you can organize the data exchange process.