Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > DataHistory

Forum

Search UsersRules
DataHistory
#1
Active user
Points:: 0
Joined:: Sep 18, 2012

Hello everyone!
I need to create log of data history (changes of any objects of type Documents.Order). For example I need to know who and when changed something (what attribute and how was changed) in these documents.
I am trying to use DataHistory functionality.
For example in "OnWrite" procedure of Document.Order object module I have written something like this:

Code
Data = ThisObject.Ref.GetObject();
CreationDate = CurrentDate();
User         = Catalogs.Users.FindByCode("Administrator");  
DataHistory.WriteVersion(
    Data,
    CreationDate,
        User.UUID(),
        User.Code,
        User.Description,
    DataChangeType.Update,
    "test");


but while I write object it gives me an error: "Metadata was not found: DocumentOrder".
I can see that line "User.UUID()" makes the error.
"User.Code" and "User.Description" are ok.
User "Administrator" exists for sure.
What am I doing wrong?
Thank you in advance for your answer.
Kris

Profile
#2
Active user
Points:: 0
Joined:: Sep 18, 2012

Ok, solved. I haven't used "DataHistoryUse" in Metadata for Order document. After using it - just works  :)

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.