API / Order Tracking: Steps to Create An Order From Scratch

Discussions related to order tracking development with the ProForm module.

Moderator: Phil Barton

Post Reply
iggygork
Posts: 1
Joined: Fri Oct 10, 2008 12:02 pm

API / Order Tracking: Steps to Create An Order From Scratch

Post by iggygork »

Hello,

I am starting to dabble in the new API in Glenwood and am wondering if there is any documentation, beyond what is supplied with the SDK , that outlines the suggested steps of creaating an order from scratch. What I am looking for is mostly along the lines of "Create this contact first, do the escrow company next" type of workflow, in addition to the description of which properties can be assigned through the API to obtain the desired result.

In particular, I don't seem to be able to assign an escrow closer (to order.Escrow.EscrowOfficerCloser) to the order via the API. This property seems to be an object inheriting from ITrustee, which has only read only properties. How does one go about assigning a closer to an order? I tried to find a method (similar to CreateNew() that is available on a number of business objects but to no avail.

Thank you very much for your time,

Gorkem Kuterdem
gkuterdem (at) onenorthpoint.com
Northpoint Escrow + Title LLC
Phil Barton
Posts: 54
Joined: Wed Sep 24, 2008 2:37 pm
Location: Raleigh, NC
Contact:

Re: API / Order Tracking: Steps to Create An Order From Scratch

Post by Phil Barton »

Here is a code snippet for creating an order from scratch:

Code: Select all

			SelectServer server = new SelectServer(null, new Uri(@"<your url"), new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain));
			SoftPro.OrderTracking.Client.OrderTracking ot = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>();
			OrderCreationSpec spec = new OrderCreationSpec();	// Use the order numbering manager for the currently logged in user.

			using ( IOrder order = ot.CreateOrder() )
			{
				try
				{
					// Work on the order
					ValidationMessage[] messages;

					if ( !ot.SaveOrder(order, out messages) )
					{
						// Handle save failures
					}
					else
					{
						// Handle save sucess
					}
				}
				finally
				{
					// Always call to release any locks
					ot.CloseOrder(order);
				}
			}
As far as assigning the Escrow Closer, there is a collection of ITrustee objects on the order. It is IOrder.AllUsers. To assign, you can do the following:

Code: Select all

				ITrustee trustee = order.AllUsers.FirstOrDefault(t => t.UserName == @"<user name I'm looking for>");

				order.Escrow.EscrowOfficerCloser = trustee;
Phil Barton
Software Architect
SoftPro
Post Reply