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