GUID/OrderNumber

Discussions related to custom development with Select.
Post Reply
PeterKelly
Posts: 92
Joined: Tue Feb 04, 2014 3:34 pm

GUID/OrderNumber

Post by PeterKelly »

Assuming I only have the OrderNumber, is there a way to get the GUID for that order via the API?

Thanks,
Peter
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: GUID/OrderNumber

Post by BobRichards »

Search the order store. There you can create all types of searches based on addresses, contact names, profiles, dates, etc. Look at SoftPro.OrderTracking.Client.Orders.IOrderInfo to see all the possibilities.

In this example, I'll look for order number 2014080009 .

Code: Select all

// Get the IOrderStore object.
SelectServer ss = GetService<SelectServer>();
IOrderStore os = ss.GetService<IOrderStore>();

// Search the order store for the desired number.
IOrderInfo oi = os.Orders.Where(t => t.Number == "2014080009").FirstOrDefault();

if (oi != null)
{
    // Valid order number: got order Guid and latest Version.
    Guid orderGuid = oi.Identifier.Guid;
}
Bob Richards, Senior Software Developer, SoftPro
PeterKelly
Posts: 92
Joined: Tue Feb 04, 2014 3:34 pm

Re: GUID/OrderNumber

Post by PeterKelly »

Thanks!
Post Reply