Validate Custom Field
Posted: Thu Jan 26, 2017 3:13 pm
I got most of the way using pieces of other samples but can't seem to get this to fire the Warning. Need the warning to fire if the custom field is not checked Field code in Select is Order.TitleCompanies.OverTheLimit_150431#
Here's what I have so far. Need help in setting the Warning to pull from custom field Order.TitleCompanies.TransactionAmount_150431#.
Also Rep just indicated they'd like it to HotSpot to a Requested Task named Over the Limit Approval if possible. HELP
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
# Edit the message below if you want to change the message.
IsOverTheLimit = 'The total liability amount [INSERT TRANSACTION AMOUNT] is over the limit authorized; please obtain approval, submit the appropriate documentation, and mark the Over the Limit Approval task complete to proceed with the order.'
##############################################################################
#
# Rule file name: 150-431_Validate Over The Limit CF.txt
#
# Validate that Over The Limit Checkbox is marked, if true raise Warning
#
#
# Version
# 1: Original
#
##############################################################################
def TCOverTheLimit_Value(args):
TitleCompany = args.Context
if TitleCompany == None:
# If no TitleCompany Exist - Exit.
return
#Get the Order Context
order = args.Context.Root
#THIS IS THE PART I CAN'T GET TO FIRE.
TCOverTheLimit = IOrder.__getitem__(order, 'TitleCompanies.OverTheLimit_150431#')
if TCOverTheLimit == True:
args.RaiseWarning(IsOverTheLimit)
# Redefine Custom Field Rule names to allow mapping to any field name.
TCOverTheLimit_Value.__name__ = 'TitleCompany_OverTheLimit_150431#_Value'
Here's what I have so far. Need help in setting the Warning to pull from custom field Order.TitleCompanies.TransactionAmount_150431#.
Also Rep just indicated they'd like it to HotSpot to a Requested Task named Over the Limit Approval if possible. HELP
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
# Edit the message below if you want to change the message.
IsOverTheLimit = 'The total liability amount [INSERT TRANSACTION AMOUNT] is over the limit authorized; please obtain approval, submit the appropriate documentation, and mark the Over the Limit Approval task complete to proceed with the order.'
##############################################################################
#
# Rule file name: 150-431_Validate Over The Limit CF.txt
#
# Validate that Over The Limit Checkbox is marked, if true raise Warning
#
#
# Version
# 1: Original
#
##############################################################################
def TCOverTheLimit_Value(args):
TitleCompany = args.Context
if TitleCompany == None:
# If no TitleCompany Exist - Exit.
return
#Get the Order Context
order = args.Context.Root
#THIS IS THE PART I CAN'T GET TO FIRE.
TCOverTheLimit = IOrder.__getitem__(order, 'TitleCompanies.OverTheLimit_150431#')
if TCOverTheLimit == True:
args.RaiseWarning(IsOverTheLimit)
# Redefine Custom Field Rule names to allow mapping to any field name.
TCOverTheLimit_Value.__name__ = 'TitleCompany_OverTheLimit_150431#_Value'