Tracked document Encompass – showing all attachments of a loan file using coding

The following code exports all of the attachments associated with the Appraisals in a loan.

using System;
using System.IO;
using EllieMae.Encompass.Client;
using EllieMae.Encompass.BusinessObjects;
using EllieMae.Encompass.BusinessObjects.Loans;
using EllieMae.Encompass.BusinessObjects.Loans.Logging;

class LoanReader
{
public static void Main()
{
// Open the session to the remote server
Session session = new Session();
session.Start(“myserver”, “mary”, “maryspwd”);

// Open and lock the next loan in the loop
Loan loan = session.Loans.Folders[“My Pipeline”].OpenLoan(“Sample”);

// Get all Appraisals from the TrackedDocument list
LogEntryList appraisals = loan.Log.TrackedDocuments.GetDocumentsByTitle(“Appraisal”);

// Save each attachment to the C:\Appraisals folder
foreach (TrackedDocument appraisal in appraisals)
foreach (Attachment att in appraisal.GetAttachments())
att.SaveToDisk(“C:\\Appraisals\\” + att.Name);

loan.Close();

// End the session to gracefully disconnect from the server
session.End();
}
}

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.