Message to management              

How to restore a deleted database item.

For example, the "Users" directory entry was deleted, after which in the orders of buyers, sales of goods and other documents in the "Responsible" requisition the value "Object not found (GUID code)".

You can suggest 2 ways to restore an erroneously deleted database item:
  1. Perform a database test with a logical integrity check. This will restore the database items that were deleted, but they were referenced in other elements of the database. When tested, they will be restored. Items that were deleted from the database and were not referenced in other database objects will not be restored.
  2. Programmatically (for the programmer). To do this, you should use the Set NewList (GUID Remote Element) function when creating a new entry in the directory. As a parameter, pass the GUID of the RemoteElement, which can be taken from any object where there is a reference to the remote object in the requisite. See the code example below.:

Procedure Button Execute Press (Button)

DirectoryUsers = Directories.Users.CreateElement ();
DirectoryName users.Name = NameForNew Element;
ReferenceSusers.InstallListNew (ObjectFor LinkLinks);
DirectoryUsers.Record ();
Report ("Recorded:" + User Guide.Links);

End of the procedure

 

Company "NCT"

26.01.2017

Back to the list