Compare 2 Order Date Values

Questions about and code samples for automation process code snippets within Select.
Post Reply
johnpbzdon
Posts: 11
Joined: Mon May 09, 2016 10:07 am

Compare 2 Order Date Values

Post by johnpbzdon »

I'm trying to set up an automation based on a custom date field {{Order.ContractRecd_150280#}} being greater than {{Order.ReceivedDate}}, but having issues. I have tried using the automation "Field is specific value" option with the > comparison operator and designating both fields as showing above, but the automation did NOT trigger. Is there a specific way the fields should be detailed? I have tested each field with a static date and it does trigger, but not when trying to compare the dates together.

If the option won't work, can you provide the code snippet syntax to compare the two fields so "True" is returned?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Compare 2 Order Date Values

Post by BobRichards »

Please provide the code snippet you are trying.
Bob Richards, Senior Software Developer, SoftPro
johnpbzdon
Posts: 11
Joined: Mon May 09, 2016 10:07 am

Re: Compare 2 Order Date Values

Post by johnpbzdon »

Hi Bob,

Thanks for the quick response.

Below are the date values I'm trying to evaluate.

{{Order.ContractRecd_150280#}} > {{Order.ReceivedDate}}

Since the "Field is specific value" of the Automation Process Wizard's "And if these conditions are met:" doesn't appear to resolve 2 order date values, I'm assuming I will have to use the "Code Snippet" option. I have just started to try and figure out the python syntax. There aren't a lot of examples to pull from so this is what I have so far (which isn't working):

from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
from SoftPro.OrderTracking.Client.Orders import *

def Order_RelatedOrders_Value(args):
# Get context (top level order object).
order = args.Context.Root

if IOrderItem.GetProperty(order, 'ContractRecd_150280#') > order.ReceivedDate
return True
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Compare 2 Order Date Values

Post by BobRichards »

This does not appear to be a valid Automation snippet. If you are actually creating a Custom Order Rule, please post to that forum. If you are trying to create an Automation snippet, please let we know so we can change it to a valid format. Thanks.
Bob Richards, Senior Software Developer, SoftPro
Post Reply