Encompass – Tracked document coding

The following code adds a new TrackedDocument to every loan in the My Pipeline folder, sets the document’s ordered day to today and allows 10 days for it to be received.

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”);

// Get the “My Pipeline” folder
LoanFolder fol = session.Loans.Folders[“My Pipeline”];

// Retrieve the folder’s contents
LoanIdentityList ids = fol.GetContents();

// Open each loan in the folder and check the expected closing date
for (int i = 0; i < ids.Count; i++)
{
// Open and lock the next loan in the loop
Loan loan = fol.OpenLoan(ids[i].LoanName);
loan.Lock();

// Add a new supporting document to the loan
TrackedDocument doc = loan.Log.TrackedDocuments.Add(“My Custom Document”,
session.Loans.Milestones.Submittal.Name);

doc.OrderDate = DateTime.Now;
doc.DueDays = 10;

// Close the loan
loan.Commit();
loan.Unlock();
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.