Data exchange - Record changes manually

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

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?

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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

 
#3
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Oct 30, 2013
Company:

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.

 
#4
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

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.

 
#5
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

The register is independent, non-periodic.

 
#6
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

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);

Edited: Daniel Miu - Jan 15, 2014 07:58 AM
 
#7
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

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"?

 
#8
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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

 
#9
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

Download 1Cv8.dt (13.61 KB)
 
#10
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Mar 8, 2012
Company: Smart ID

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.

Edited: Daniel Miu - Jan 16, 2014 02:01 AM (Attached configuration update)
 
#11
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
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.