Where are the 1c exchange rules stored? Data conversion - to create data exchange rules. Filter by organization

How to use exchange rules

To transfer data from one database to another using exchange rules, you need to create exchange rules and use processing.

How to create exchange rules

Using exchange rules, data can be transferred between databases with any configuration. This article explains the creation of exchange rules for databases with the same configurations (Enterprise Accounting 2.0). This transfer can be done using standard processing. But this processing transfers data of reference types only by reference, and transfers data of primitive types and predefined data by value. For a more complex transfer, when, for example, you need to search for a directory element by name, you need to create exchange rules.

Information bases created by 1C have a similar data structure. Therefore, it will be easier to write rules for these databases. If the information base manufacturers are different, then it is more difficult to write transfer rules, and in some cases it is not advisable.

Rules are created in the infobase with the "Data Conversion" configuration.

1) Infobase configurations

To create transfer rules between databases, you will need descriptions of the structure of these databases. To unload the information base structure, special processing is used (MD82Exp.epf, MD83Exp.epf), which are supplied along with “Data Conversion”.


After downloading the database structure, it must be added to the list of configurations.

2) Data exchange rules

List of conversions

Adding a new conversion

Editing exchange rules


A conversion rule for an object can be created automatically by clicking on the "Synchronize objects..." button. Below is an example of creating a rule manually for the "Currencies" directory. After clicking the "Add" button on the "Object Conversion Rules" tab, the assistant for adding a new rule will open.

1) First you need to select the source and destination infobase objects.

2) Here you need to set the transfer settings.

3) In event handlers in the built-in language, you can write your own algorithms for processing data during transfer.


Task

Transfer information about counterparties from UP V BP. Data is transferred unilaterally, identification is made using a unique identifier. Conversion rules are configured using a special configuration Data conversion, edition 3.0(Further - KD 3.0).

Actions Performed

Stage 1. Preparing to configure the rules.

To configure conversion rules in the configuration KD 3.0 must contain information about the structure of the information bases between which data is synchronized, as well as about the structure of the format Enterprise Data.

Step 1. Uploading the structure of the UP and BP information bases.

To download information about the structure of the infobase, processing is used MD83Exp.epf, included in the configuration package KD 3.0.

For each infobase ( UP And BP) you must perform the following steps:

  1. Open the infobase in Enterprise mode.
  2. Open external processing MD83Exp.epf(Menu File & Open).
  3. Specify the name of the file in which to save the infobase structure.
  4. Check the settings in the processing form (all flags must be cleared).
  5. Press the button Unload.

Step 2. Export the xml exchange format scheme

To download the exchange format scheme, standard platform capabilities are used.

You need to do the following:

  1. Open one of the information databases (or UP or BP) in the “Configurator” mode.
  2. In the metadata tree, find XDTO packages with names ExchangeMessage And EnterpriseData_1_0_beta.
  3. Place the cursor on the XDTO package, right-click and select the item in the context menu Export XML Schema. Specify the path and file name to export. Perform this step for each of the two packages, saving the XML schemas in two different files.

Step 3. Loading the infobase structure into the CD 3.0 configuration

Loading is done into the configuration KD 3.0 in Enterprise mode. The following steps should be performed for each of the configurations for which conversion rules are configured ( UP And BP).

  1. Go to section Configurations, and select the command
  2. Specify the path to the file with the infobase structure (see. Stage 1, Step 1).
  3. Specify download method & to the new configuration version.
  4. Press the button Execute download

Step 4. Loading the exchange format structure into the CD 3.0 configuration

  1. Go to section Data Format, and select the command.
  2. Specify files with format structure (see. Stage 1, Step 2). You must specify both files at once using multiple selection.
  3. Check the main XDTO package name - must match the XDTO package namespace EnterpriseData_1_0_beta(see in the configurator UP or BP).
  4. Specify download method & to the new version of the format.
  5. Press the button Execute download, wait for the download to finish.

Stage 2. Creating conversions

To solve the described problem, you need to create two conversions:

  • UE (for downloading data from UP to exchange format)
  • BP (for loading data from the exchange format to BP)

Conversions are created in the section Conversions, team Conversions. For a new conversion, you must specify the name, configuration and exchange format. For example, conversion for the UE configuration:

  • Name& “UP2.0.7”.
  • Configuration& “Enterprise Management”.
  • Supported format versions& one line in which a single directory entry is selected Format versions.
  • data processing rules,
  • object conversion rules,
  • rules for converting predefined data.

To go to a set of rules for a specific conversion, you need to go to the section Conversions, select a team Setting up conversion rules and select a specific conversion from the list for which the rules will be configured. As a result, the form will open Setting up exchange rules, which contains all the rules for a specific conversion.

Stage 3. Creating object conversion rules

Step 1. Conversion rule for unloading counterparties from the UE

  1. UP.
  2. Go to bookmark
  3. Basic information:
    1. Rule ID: “Directory_Counterparties_Dispatch”,
    2. Configuration object
    3. Format object: “Directory. Counterparties”,
    4. Application area: To send.
  4. Press the button Write down and go to bookmark Property conversion rules:
    1. Use the automatic property matching service
      1. Press the button Setting up PKS
      2. In the form that opens, click Automatch. The properties “TIN”, “KPP”, “Name”, “Full Name”, “Additional Information”, “LegalIndividual” will be compared.
      3. and close the form for setting up property conversion rules
  5. Press the button Save and close.

Step 2. Conversion rule for loading counterparties into the BP

  1. Open the exchange rules setting for conversion BP.
  2. Go to bookmark Rules for converting objects.
  3. Create a new conversion rule and fill in the data on the tab Basic information:
    1. Rule ID: “Directory_Counterparties_Receipt”,
    2. Configuration object: “DirectoryLink.Counterparties”,
    3. Format object: “Directory. Counterparties”,
    4. Application area: For getting.
  4. Press the button Write down and go to bookmark Identification. Specify the identification method “By unique identifier”.
  5. Go to bookmark Property conversion rules
    1. Use the automatic property matching service:
      1. Press the button Setting up PKS
      2. In the form that opens, click Automatch. The properties “TIN”, “KPP”, “Name”, “Full Name”, “Additional Information”, “LegalIndividual” will be compared.
      3. Save the result of automatic matching & press the button Create property conversion rules and close the form for setting up property conversion rules.
    2. Manually add a property conversion rule for OKPO (configuration property & “CodePoOKPO”, format property & “OKPO”).
    3. Later, you will need to return to the property conversion rules to populate the property conversion rule for the “LegalIndividual” property, which is an enumeration.
  6. Go to bookmark Before Recording the Received Data and write an algorithm to fill in the country of registration of a new counterparty. The algorithm contains the following text: “Received Data. Country of Registration = Directories. Countries of the World. Russia;”.
  7. Press the button Save and close.

Stage 4. Creating rules for converting predefined data

  1. UP or BP)
  2. Go to bookmark Rules for converting predefined data
  3. Create a new conversion rule and fill in its properties:
    1. Rule ID: “Transfer_LegalIndividual”
    2. Configuration object: “TransferLink.LegalIndividual”
    3. Format object: “LegalIndividual”
    4. Application area: for sending and receiving
    5. In the table field, fill in the correspondence between the configuration and format enumeration values: “Individual” & “Individual” and “Legal Entity” & “Legal Entity”
    6. Press the button Save and close
  4. Specify a new rule in the conversion rule for the “LegalIndividual” property of the directory Counterparties
    1. Go to bookmark Object conversion rules
    2. Counterparties, open the rule form
    3. Go to bookmark Property conversion rules and find the rule for the property “LegalIndividual”
    4. Open the property conversion rule form and indicate in it the object conversion rule & “Transfer_LegalIndividual”.
    5. Save your changes

Stage 5. Creating data processing rules

The procedure is the same for both conversions.

  1. Open the exchange rules setting for conversion ( UP or BP)
  2. Go to bookmark Object conversion rules
  3. Find directory conversion rule Counterparties, open the rule form
  4. Press the button Create based on & Data Processing Rule
  5. In the created data processing rule, check the automatically filled properties:
    1. Rule ID& specify the same as for the data processing rule (“Directory_Counterparties_Sending” or “Directory_Counterparties_Receiving”)
    2. Application area& same as for data processing rule
    3. Sample object:
      1. for conversion UP& “DirectoryLink.Counterparties”
      2. for conversion BP& “Directory. Counterparties”
    4. Object conversion rule& link to the object conversion rule.
  6. Press the button Record and close.

Stage 6. Obtaining data exchange manager modules

The data exchange manager module is required to exchange data between configurations in accordance with those configured in KD 3.0 rules.

The procedure is the same for both conversions:

  1. Open information base UP or BP in the “Configurator” mode. Find a common module in the metadata tree Exchange Manager Through Universal Format and open it for editing. The module must be empty.
  2. Open information base KD 3.0 in Enterprise mode.
  3. Go to section Conversions and select a team Unloading the module.
  4. In the form that opens, indicate the appropriate conversion and click the button Unload. The module will be copied to the clipboard.
  5. Go to the infobase configurator UP or BP and paste the contents of the clipboard into the shared module Exchange Manager Through the Universal Format.
  6. Save the configuration.

The module can also be uploaded to the clipboard from the form for setting up exchange rules using the button Save exchange manager module.

In order for data to be exchanged according to the configured rules, it is necessary to configure data synchronization in both information bases in the “Enterprise” mode through a universal format.

Data exchange between 1C 8 application solutions is something without which it is not possible to build a full-fledged enterprise information space.

  • Why are data exchanges needed and how to use them?
  • Types of exchanges between 1C.
  • How to configure data exchange between 1C databases?

You will find out the answers to these questions below.

There are usually two reasons for introducing exchanges:

The organization has a branch network

In this case, you simply need to set up the exchange between different branches. For this purpose, there is a mechanism in the 1C 8.3 enterprise system. With which you can flexibly configure the exchange of information. For example, for branches you can disable the visibility of documents for other branches and at the same time the central office will see documents of all branches. Another example is setting up an exchange between the 1C Retail databases of an office and stores.

Separation by type of accounting

As a rule, this means that the organization maintains different records in different information databases. This separation allows you to filter information that is “unnecessary” for another type of accounting for various information bases. Example: so-called “Management accounting” will be entered into the “Trade Management” database, where all transactions are reflected, and management sees the full picture of events, and only the documents necessary for accounting and tax accounting are uploaded to the regulated accounting database “Enterprise Accounting”.

What are the exchange mechanisms between 1C databases?

Data exchanges can be classified in two ways: the mechanisms used and the transport used for the exchange.

1C data exchange mechanisms

Typically, two mechanisms are used for exchange:

  • Distributed information base (RIB)— a mechanism that allows you to set up data exchange between branches. The mechanism implies that absolutely identical database configurations are exchanged. The mechanism can transfer database configuration changes. The mechanism is implemented at the technology platform level.
  • A universal mechanism for exchanging between configurations— the mechanism is developed by 1C for application solutions. It is universal and based on . Data exchange is carried out using xml rules, which are created in a special configuration - . Using this mechanism, you can implement both one-time exchange and constant exchange between 1C configurations. The mechanism is implemented at the configuration level; you can integrate it into your configuration from the technological configuration.

Transport for data exchange

Transport can be a fairly wide range of technologies. Let's consider the main ones implemented in the universal exchange mechanism 1C 8.2:

Get 267 video lessons on 1C for free:

  • Local or network directory- the simplest transport. One information security creates a file on the disk, the second reads it and adds its own file.
  • FTP resource- exchange is similar to exchange through a catalog. The difference is that the exchange is carried out via the FTP protocol.
  • Postal messages or E-mail— the exchange takes place via email. The configurations send mail messages to each other and regularly check the mail address for new messages.
  • Direct connection (COM)— the exchange is carried out through a direct connection of one database to another using funds.
  • Internet (Web service)— the transport is a web service. One infobase connects to , the web service connects to the second infobase and transports the message. To carry out such transport you must have.

How to set up data exchange between 1C databases?

For the basics of setting up data exchange in 1C using the “1C Data Conversion” configuration, see the example in the video:

1C data exchange according to schedule in 1C 8.2

If you need to configure automatic uploading on a schedule, just configure .

For client-server version

In the “Data exchange settings” directory, on the “Automatic exchange” tab, you need to create a new scheduled task, where you specify the schedule:

For file option

In the “Data exchange settings” directory, on the “Automatic exchange” tab, you need to create a new routine task, where, on the “Exchange by events” tab, specify the events on which the exchange will be launched. For example, when a specific user starts:

If you exchange data between the Trade Management 10.3 and Enterprise Accounting 2.0 configurations, then after updating one of the configurations, you need to update the exchange rules.

Let's consider the case when the exchange was configured from the Trade Management configuration and configured through a direct connection to the receiver base, i.e. accounting department You need to download new rules through the data exchange settings in Trade Management. It is highly recommended to make a base before doing this.

Let's get started with 1C Trade Management 10.3. Select the item “All data exchange settings” from the Tools menu => Other data exchanges.

Select the “All exchanges” section. Find your data exchange in the list, right-click and click “Edit”. If you try to change the exchange settings from the “Data exchange with 1C: Accounting 8” section, then when you try to change, the data exchange setup assistant will be launched, which we do not need.

In the window that appears, we see that the exchange occurs according to the exchange rules, which can be saved and loaded. The rules for uploading to the exchange database are the rules by which information is uploaded from Trade Management to Accounting, and the rules for uploading from the exchange database to the current database are the rules by which information is loaded from Accounting to Trade Management.

Let's load the upload rules into the exchange database. Click “Load rules from file”. Attention, if you have a non-standard configuration and use non-standard exchange rules, i.e. developed specifically for your modified configuration, then you should contact specialists to create new rules based on existing ones.

Do not under any circumstances replace them with standard rules. If you are not sure that you have standard configurations, just in case, save the existing rules with the “Save rules to file” button.

Since the latter came out much later than the update for Trade Management, we are looking for exchange rules in the catalog of 1C update templates for Accounting. You can find the update template directory as follows. Launch 1C and click “Settings”. In the window that appears, we see the path to the directory of configuration templates and updates.

Let's move on this path. Next: 1C => Accounting and select the folder with the name of the latest installed release of Accounting. If the rules need to be taken from the “1C: Trade Management” configuration update, the folder will be called Trade. For the “1C: Retail” configuration - Retail. It contains the “Data Exchanges” folder.

Next “Exchange with configuration Trade management, ed. 10.3". In it we see the RULES FOR BP-UT CONVERSION and RULES FOR UT-BP CONVERSION. Since we need rules for unloading from UT, select “UT-BP CONVERSION RULES” and click open. We do the same for the rules for uploading from the exchange database to the current database, just select the BP-UT CONVERSION RULES file and click open.

In the folder “Exchange with configuration Trade management, ed. 10.3” is the Sharing.htm file. If you have never read it, be sure to read it. It contains the following useful information:

  • Sharing purposes
  • general description
  • Migration from previous versions of two-way communication
  • Preliminary actions
  • Procedure for setting up data exchange between configurations
  • Data synchronization
  • Collaboration of the “Trade Management” and “Enterprise Accounting” configurations
  • Examples of user scenarios
  • Correspondence table of uploaded documents UT - BP (revision 1.6, edition 2.0) Correspondence table of uploaded documents BP (revision 1.6, edition 2.0) - UT
  • Features of uploading documents and reference books
  • Conformity table for uploaded BP documents (revision 1.6, revision 2.0) - UT
  • Transfer of documents “Invoice for payment to the buyer” and “Buyer’s order”
  • Transfer of cost of write-off of goods
  • Monitoring the results of data exchange

We check the rules using the check buttons. And click OK. The new rules have been saved. We start data exchange and check its operation.

How to set up two-way data exchange between the Trade Management 10.3 and Enterprise Accounting 2.0 configurations is written in my other article.

When developing 1C 8 exchange rules, the ability to programmatically redefine the behavior of exchange rules is widely used - the handler mechanism. Event handlers significantly expand the functionality and are an indispensable tool for setting up exchange rules in cases where interactive configuration capabilities are not enough.

Handlers and algorithms are written in the language of the platform in which they will be executed during the exchange.

If this is a 1C: Enterprise 7.7 platform, then the handler code is integrated into the upload or download processing code. Accordingly, each handler or algorithm is separated into a separate function and is available for debugging during exchange.

If uploading or downloading occurs on the 1C: Enterprise 8 platform, then the handler code is not integrated into the data exchange processing code, but is uploaded to the exchange rules file. During the data exchange process, the code of handlers or algorithms is taken from the rules file and executed directly in the context of the “Run” statement. To debug the code of handlers and algorithms, you can use the “Universal XML Data Interchange” processing.