Click or drag to resize

IDocumentManagerByInventoryId Method (Int32)

Retrieves a Document by its unique identifier

Namespace:  EdaIntegrationContract.Document
Assembly:  EdaIntegration.Contract (in EdaIntegration.Contract.dll) Version: 7.6
Syntax
C#
IDocument ByInventoryId(
	int inventoryId
)

Parameters

inventoryId
Type: SystemInt32
The unique identifier of the document to find

Return Value

Type: IDocument
The document with the supplied unique identifier
Exceptions
ExceptionCondition
EdaApiExceptionThrown if a document cannot be found with the specified Id
Examples
The following example demonstrates retrieving a document using its id.
C#
using EdaIntegrationContract;
using EdaIntegrationContract.Case;
using EdaIntegrationContract.Document;

class Sample
{
    public static void Main()
    {
        var edaIntegration = new EdaIntegration().ConnectToExplore();

        ICase edaCase = edaIntegration.Cases.OpenCaseByName("Case 1");
        IDocument doc = edaCase.Documents.ById(15);
        Console.WriteLine("Id: {0}", doc.Id);
        if (doc.DocumentType == DocumentType.EDocument)
        {
            Console.WriteLine("File Name: {0}", doc.FileName);
        }
        else if (doc.DocumentType == DocumentType.Email)
        {
            Console.WriteLine("Subject: {0}", doc.EmailMetadata.Subject);
        }
    }
}
/*
This example produces the following results:

Id: 15
Name: lorem_pw.docx
 */
See Also