asked two days ago Show version history

Hi,

I want to delete an entry and state the reason for deletion through the API. Because our web app interacts with the Laserfiche repo, I want to log the actual user who deleted the file from our web app as a reason so that it is visible in LF Audit Trail. I tried using the DeleteEntryWithAuditReason class with the Comment property, but in Laserfiche Audit, nothing shows up for the reason for that deleted Entry.

Here is my code:

try
{
    if (parentID > 0)
    {
        string AuthorpersonNumber = "personABC";
        string reason = $"Deleted by {AuthorpersonNumber}";
        DeleteEntryWithAuditReason lfReason = new DeleteEntryWithAuditReason();
        lfReason.Comment = reason;
        AcceptedOperation del = await client.EntriesClient.DeleteEntryInfoAsync(LSRepo, parentID, lfReason);
        await Task.Delay(200);                        
        OperationProgress op = await client.TasksClient.GetOperationStatusAndProgressAsync(LSRepo, del.Token);

        int retryTimes = 0;
        while (!op.Status.Equals(OperationStatus.Completed) && retryTimes < 10)
        {
            await Task.Delay(200);
            op = await client.TasksClient.GetOperationStatusAndProgressAsync(LSRepo, del.Token);

            retryTimes++;
        }

        if (!op.Status.Equals(OperationStatus.Completed))
        {
            throw new AsynchronousOperationException($"Operation Status: {op.Status.ToString()}");
        }
    }
}
catch (Exception e)
{
    throw new AsynchronousOperationException(string.Format("Unable to delete document {0} from Laserfiche: {1}", docID, e.Message));
}

Am I misunderstanding what the Comment field does, or does it have to match a reason in the configured list in the Auditing options in management of the repo?

Ex.

0 0