Saving an order in 3.0

Discussions related to custom development with Select.
Post Reply
User avatar
uwdoug79
Posts: 78
Joined: Wed Aug 07, 2013 12:43 pm
Location: Earth
Contact:

Saving an order in 3.0

Post by uwdoug79 »

The following code in the 3.0 Select SDK help file does not work.

Code: Select all

           // Create the server object.  Note the use of the constant to define custom login.
            NetworkCredential credential = new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain);
            SelectServer server = new SelectServer(null, new Uri(@"http://localHost:80/SelectServer"), credential);

            // Create the order tracking client
            SoftPro.OrderTracking.Client.OrderTracking ot = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>();

            using (IOrder order = ot.CreateOrder())
            {
                try
                {
                    // TODO: Manipulate the order

                    ValidationMessage[] messages;

                    // Save the order.  A failure to save will return false.  Error messages will be returned in
                    // the messages out parameter.
                    if (!ot.SaveOrder(order, out messages))
                    {
                        // Handle order save failure
                    }
                    else
                    {
                        // Handle order save success
                    }
                }
                finally
                {
                    // This MUST be called to release any locks on the order.
                    ot.CloseOrder(order);
                }
            }
What is the Cameron equivalent to saving a created order?
ot.SaveOrder is not a valid method. What would be the new way that returns the array of messages? ValidationMessage also is no longer a valid object.

Doug
Doug Hamilton
CHICAGO TITLE
20825 SWENSON DR SUITE 300 WAUKESHA, WI 53186
P: 262-796-3808 F: 262-796-3888
EMAIL: Doug.Hamilton@fnf.com
www.wi.ctic.com | www.chicagoagent.com | www.etitle.ws
User avatar
uwdoug79
Posts: 78
Joined: Wed Aug 07, 2013 12:43 pm
Location: Earth
Contact:

Re: Saving an order in 3.0

Post by uwdoug79 »

Also,

Order.Number is no longer valid. When the order is returned after saving, how is the new order number created pulled out of the order object?

Doug
Doug Hamilton
CHICAGO TITLE
20825 SWENSON DR SUITE 300 WAUKESHA, WI 53186
P: 262-796-3808 F: 262-796-3888
EMAIL: Doug.Hamilton@fnf.com
www.wi.ctic.com | www.chicagoagent.com | www.etitle.ws
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: Saving an order in 3.0

Post by john.morton »

There's a sample in the following thread that shows saving an order. Basically, you use the IOrderStore.ApplyChanges() method:
viewtopic.php?f=19&t=348

...and this thread has a sample of how to get the equivalent of "validationMessages" in 3.0. You can get use GetMessages right from IOrder:
viewtopic.php?f=19&t=639
Order.Number is no longer valid
There are two different ways to get to properties on our non-strongly typed objects in 3.0. You can use a dynamic version of IOrder, which will let you just do order.Number
Or, all IOrderItems (like IOrder) have .GetProperty(), .SetProperty(), .HasProperty(), .GetIsSupported() methods you can use. So, can use IOrder.GetProperty("Number");
Post Reply