HOA Charges

Questions about and code samples for custom order rules and validation within Select.
Post Reply
bdutil
Posts: 121
Joined: Tue Jul 19, 2016 1:48 pm

HOA Charges

Post by bdutil »

Borrowed from another rule but can't get this to point at the HOA CHarge screen. What am I missing in the context?

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.
NoCDFLine = 'Enter a CDF Line for the HOA Amount.'
NoHUDLine = 'Enter a HUD Line for the HOA Amount.'

##############################################################################
#
# Rule file name: 601-519 Require HUD/CDF Line if amount entered in the HOA screen
# Fires on 2nd save
# Ignores Templates
#
# Version
# 1: Original
#
##############################################################################

def HOACharge_CDFLine_Validate(args):
HOACharge = args.Context
order = args.Context.Root

# Exit if this is a template.
if order.IsTemplate:
return

# Ignore rule until 2nd order save.
if order.Identifier.Version < 2:
return

# Require CDF Line
if HOACharge.Amount > 0:
if HOACharge.CDFLine is None:
args.RaiseError (NoCDFLine)

def HOACharge_HUDLine_Validate(args):
HOACharge = args.Context
order = args.Context.Root

# Require HUD Line
if HOACharge.Amount > 0:
if HOACharge.HUDLine is None:
args.RaiseError (NoHUDLine)
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: HOA Charges

Post by BobRichards »

I opened the Field Code Browser (FCB) and clicked in the Line drop down control. With the FCB "link" button enabled, I saw that the context for the field is "Proration" and not "HOACharge" as in your rule. Rename the rule and try again.

Code: Select all

def Proration_CDFLine_Validate(args):
	... remaining code ...
Bob Richards, Senior Software Developer, SoftPro
Post Reply