Filtering Out Templates, etc.

Discussions related to SoftPro Select Server development.

Moderator: Phil Barton

Post Reply
dlerickson
Posts: 82
Joined: Tue Jan 21, 2014 11:35 am
Location: Austin, TX

Filtering Out Templates, etc.

Post by dlerickson »

When handling one of the order save events (i.e. IOrderStore.OrderSaved), what's a good way to filter the Orders that are passed through to determine if the Order is an actual Title order as opposed to a template, etc.? I tried going with IOrder.IsDesignMode, but that only seems to return a true value on newly created templates, not previously existing ones that are being saved after editing. Is there some other reliable method of doing this?
dlerickson
Posts: 82
Joined: Tue Jan 21, 2014 11:35 am
Location: Austin, TX

Re: Filtering Out Templates, etc.

Post by dlerickson »

Nevermind on this, I found the IOrderInfo.IsTemplate property. Is there anything else that I'd need to filter out, though?
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Filtering Out Templates, etc.

Post by BobRichards »

The event passes in the current order and its prior version (if it exists). You are free to validate any other order properties you want. Perhaps you only care about orders with specific contacts - you can look at the Contacts collection. Perhaps you only care about orders that meet specific Order Types - you can check to ensure the Order Type is "Title Only".

Since you know it is an actual order (and not a template), that is all the "generic" filtering that I know of to ensure you have an order.
Bob Richards, Senior Software Developer, SoftPro
Post Reply