Favorites

Favorites can be set in DMS on files/folders and, of course, documents. Generally, you can add such objects to a user's favorites or remove them. Favorites are managed per user.

Document Favorites

// add
var success = await dms.Favorites.AddDocumentsToFavorites(listOfDocumentIds);
// remove
var success = await dms.Favorites.RemoveDocumentsFromFavorites(listOfDocumentIds);

These two calls can be used to modify document favorites.

File/Folder Favorites

from API 7.5.31 / DMS 7.4

// add
var success = await dms.Favorites.AddContainerToFavorites(dossierOrFolderId);
// remove
var success = await dms.Favorites.RemoveContainerFromFavorites(dossierOrFolderId);

These two calls can be used to add or remove a file or folder from favorites.

Query Favorites

Favorites are queried through a single method and include both document and file/folder favorites.

var modus = FavLoadModus.All;
var favorites = await dms.Favorites.LoadContainersByFavorites(orderField, modus);

The result object contains several ID lists for the different types of favorites. favorites.ManualDocumentFavorites includes all document IDs that are in the favorites list. However, it also includes documents marked for deletion. These can be identified and handled accordingly using the DeleteMarkedDocumentIds list.

To efficiently determine the associated files/folders, their IDs are also provided in ContainersOfManualDocumentFavorites.

Files/folders explicitly set by the user as favorites are included in the ManualContainerFavorites list.

The list of automatic container favorites works a bit differently and is usually empty.

Using the modus parameter, the result can be limited to manual favorites. In this case, neither automatic favorites nor the list of documents marked for deletion are provided. These lists will then be empty.

FavLoadModus. Meaning
All All favorites and documents marked for deletion are loaded.
ManualOnly Only manual favorites are loaded.
This article has been automatically translated by an AI and may therefore contain errors.

Related to