Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Integration > Data exchange - Record changes manually

Forum

Search UsersRules
Data exchange - Record changes manually
#1
Just came
Points:: 0
Joined:: Mar 8, 2012

Hello,
I'm using the data exchange mechanism to backup some data from one infobase to another (distributed infobases), but I have a problem when I try to manually record changes for one particular information register. For several reasons, I don't need for changes to be automatically recorded for this metadata object, so its "AutoRecord" property is set to "Disable" in the exchange plan's content.

The method I've tried is presented below, but unsuccessfully.
Inside the recordset module of this information register I use the following code:

Code
Procedure OnWrite(Cancel, Replacing)
   If DataExchange.Load Then
      Return;
   EndIf;
   
   // Record changes for backup node
   Node = ExchangePlans.ExchangePlan.FindByCode("BKUP");
   If Not Node.IsEmpty() Then
      ExchangePlans.RecordChanges(Node, ThisObject);
   EndIf;
EndProcedure

No errors are encountered on compiling/running the code, but after making changes in the register and writing database changes to XML file, I can't see any of the occurred changes. I mention that I've tried the same method but for a catalog configuration object, and it worked.

Can someone provide any help in order to solve this problem?

Profile
#2
Guest
Points::
Joined::

Hello, Daniel, if your register is independent or has a recorder?

Profile
#3
Just came
Points:: 0
Joined:: Oct 30, 2013

Is this independent register or it subordinate to recorder? If second, just don't post recorder, just write it. If first, exclude this register from exchange plan.

Profile
#4
Just came
Points:: 0
Joined:: Mar 8, 2012

While doing some research, I've discovered that the registration problem was caused by the type I've used for the information register's dimension, which was UUID.

Since then, I've tried to use multiple dimensions with different object types, and every time I've used at least one dimension of type UUID, the problem was reproduced - the occurred changes were not registered. When no dimension of type UUID was used, the registration using the code from previous post has worked properly.

Profile
#5
Just came
Points:: 0
Joined:: Mar 8, 2012

The register is independent, non-periodic.

Profile
#6
Just came
Points:: 0
Joined:: Mar 8, 2012

Anton Gritskov, if I exclude this register from exchange plan, I don't think I will be able to backup the data from it using WriteChanges()/ReadChanges() methods available for ExchangePlansManager object. At least as I do it now.

The RecordChanges() method will also not work for this register - the reference to the changed recordSet ("ThisObject" from the above code) will be seen as an invalid parameter on executing:

Code
ExchangePlans.RecordChanges(Node, ThisObject);

Profile
#7
Just came
Points:: 0
Joined:: Mar 8, 2012

Regarding to this post, another thing that I've remarked during tests is that if I set the "AutoRecord" property to "Enable" for this register, then the registration of changes works properly even if there are one or multiple dimensions of type "UUID".

So the question would now be, how could I record changes manually for a register that uses dimensions of type "UUID"?

Profile
#8
Guest
Points::
Joined::

Daniel, you could use string with UUID as for now. We will check this information and let you know.

Profile
#9
Guest
Points::
Joined::

Daniel, please provide your configuration where your problem can be reproduced and a version of 1C:Enterprise that you use. As I tried to do that and see that change is recorded. See the attached database.

Profile
#10
Just came
Points:: 0
Joined:: Mar 8, 2012

Timofey, below I've attached a configuration where the problem can be reproduced. After loading it, please make sure that the slave node in exchange plan will have the code "BKUP".
The version of 1C:Enterprise I use is 8.2.19.76.

I think the InfoBase you've attached was dumped from a 8.3 version, because I get "Bad file format for restoring InfoBase" error when I try to restore it.

Profile
#11
Guest
Points::
Joined::

Thank you, Daniel, I have sent this information to the developer team.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.