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:
- 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.
- 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);
Report ("Recorded:" + User Guide.Links);
End of the procedure