|  | IDocumentManagerByInventoryId Method (Int32) | 
 
                Retrieves a Document by its unique identifier
            
 
    Namespace: 
   EdaIntegrationContract.Document
    Assembly:
   EdaIntegration.Contract (in EdaIntegration.Contract.dll) Version: 7.6
 Syntax
SyntaxIDocument ByInventoryId(
	int inventoryId
)
Parameters
- inventoryId
- Type: SystemInt32
 The unique identifier of the document to find
Return Value
Type: 
IDocumentThe document with the supplied unique identifier
 Exceptions
Exceptions| Exception | Condition | 
|---|
| EdaApiException | Thrown if a document cannot be found with the specified Id | 
 Examples
Examples
                The following example demonstrates retrieving a document using its id.
                
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);
        }
    }
}
 See Also
See Also