In 1C:Enterprise mode

Let us enter the values required for data exchange.

  1. Start the department infobase in the debug mode and open the Departments exchange plan (fig. 24.24).

    Fig. 24.24. Nodes of the Departments exchange plan

    Note that in the infobase of the subordinate node the subordinate node itself (Department) is a predefined exchange plan node, while the central infobase node is marked by a yellow icon, indicating that it is the master of the department infobase. Additionally, the only available commands for the central infobase are Write changes and Read changes.

    Now let us test the data exchange.
  2. Set the Numbering prefix to DP.

    Note. If you completed Lesson 25 (Functional options) prior to lesson 24, some sections might be hidden from the sections panel (for example, the Accounting section). If this is the case, open the General settings form and check the values of the functional options that define section visibility (for example, the Accounting option). Note that functional options are not transferred between nodes, you have to specify their values independently for each node.
  3. Open the Customers catalog and add a new customer.
  4. Open the Departments exchange plan, select the Central infobase node (the node where you need to transfer the changes), and click Write changes.
  5. In the Write message with changes dialog box, click Write and save to file.
  6. Click Save and specify the message file name (fig. 24.25).

    Fig. 24.25. Write message with changes dialog box
  7. In the Write message with changes dialog box, click Close.
  8. Start the central infobase in the debug mode, open the Departments exchange plan, click the Department node (the node whose changes you need to transfer to the central infobase), and click Read changes.
  9. In the Read message with changes dialog box, click Select file and read changes.
  10. Specify the message file name and click Open.
  11. In the Read message with changes dialog box, click Close.
  12. Ensure that the new customer created in the department infobase is now available in the central infobase as well.
  13. Close the 1C:Enterprise window of the central infobase.
    Next, let us test how configuration changes are transferred between the master node and subordinate ones.
  14. In Designer of the central infobase, create a constant named NewConstant.
  15. In the Warehouses catalog, add a predefined item named Office with code 000000003.
    When you start creating the predefined item, the platform provides 000000002 as the default code value. But the catalog already includes a Retail warehouse with code 000000002, which was created in 1C:Enterprise mode, so you have to change the code to make it unique.
  16. Update the database configuration and start 1C:Enterprise in the debug mode.
  17. Open the Departments exchange plan and write the changes for the Department subordinate node.
  18. Close the 1C:Enterprise window and close Designer of the department infobase.
  19. Run the department infobase in 1C:Enterprise mode and read the changes from the Central infobase node.

    Once the changes are read, the following message is displayed (fig. 24.26).

    Fig. 24.26. System message
  20. Close the 1C:Enteprise window, open Designer of the department infobase, and ensure that the NewConstant constant is now available in the configuration, as well as the Office predefined item of the Warehouses catalog.

    In other words, the changes made to the central infobase configuration have been replicated to the configuration of the subordinate node.

    Now everything you need to do is update the infobase configuration in the subordinate node.

    We should probably say a few words concerning the order of applying changes when a single message contains changes to both the configuration and the data.

    In this case, the base configuration is changed first, and then a message is displayed prompting you to update the database configuration.

    But at that point the new data is not yet added. For example, the Office predefined item is not yet present in the Warehouses catalog.

    Unlike universal data exchange, the distributed infobase scenario is free of the issue related to duplication of predefined data. This is because the automatic creation of predefined data is not performed in subordinate nodes of a distirbuted infobase.

    After synchronizing the configurations, you have to reread the data, and this time all of the data changes stored in the message are applied. The order of applying changes remains the same regardless of whether the changed data refers to existing configuration objects or new ones.
  21. Delete the NewConstant object and the Office predefined item of the Warehouses catalog.
Next page: Script-based exchange
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.