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?
Compare 2 Order Date Values
-
- Posts: 1376
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Compare 2 Order Date Values
Please provide the code snippet you are trying.
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 11
- Joined: Mon May 09, 2016 10:07 am
Re: Compare 2 Order Date Values
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
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
-
- Posts: 1376
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Compare 2 Order Date Values
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