How do I audit an Overlay Order action?

Discussions related to custom development with Select.
Post Reply
toddsou
Posts: 75
Joined: Wed Jul 25, 2012 9:39 am

How do I audit an Overlay Order action?

Post by toddsou »

Hi-

In the Select UI, the user already has an Order open, and they can choose to overlay that open order with another one.

What options do I have to audit that action?

Basically, I'd like to record something like
"User xyz overlaid order number abc with order number def."

I know the order has not been saved to the db until the user clicks the Save button, but are there UI events to which I can subscribe to capture the source of the overlay ?

...or am I at the mercy of the server-side Order Saved event, and even then I'm not sure if this type of information is available.

Advice appreciated.

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

Re: How do I audit an Overlay Order action?

Post by BobRichards »

The overlay order number is captured to the Order History log. Open the order, click Order History then look for Overlay Order in the descriptions. If you double-click on the version record, you can see the order number that was overlaid.
Bob Richards, Senior Software Developer, SoftPro
toddsou
Posts: 75
Joined: Wed Jul 25, 2012 9:39 am

Re: How do I audit an Overlay Order action?

Post by toddsou »

...and how to do that via the API ?

Thanks.

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

Re: How do I audit an Overlay Order action?

Post by BobRichards »

There are two sources of information - The first is if you are just concerned with template operations:

Open the order from the OrderStore then examine the order TemplateHistory collection. There will be an entry for each operation with an OverlayAction of:
  • OnOrderCreation - Loaded during initial order creation
  • ApplyTemplate - Apply Template operation
  • Overlay - Overlay Order operation
The second source of information is to get the order history with template plus other information.

Code: Select all

// Open order (read-only in this example).
IOrderStore os = ss.GetService<IOrderStore>();
IOrderInfo orderInfo = os.Orders.Where(t => t.Number == "XAT17000007").FirstOrDefault();
IOrder iOrder = os.OpenOrder(orderInfo, true);

// Get all order history from latest order.
IOrderHistory[] hx = os.GetOrderHistory(new OrderIdentifier(iOrder.Guid, -1));
Bob Richards, Senior Software Developer, SoftPro
Post Reply