Code: Select all
def PreliminaryTitleOpinion_HST_FS_35LandVal(args):
args.Value = args.Context.HST_FS_100LandVal * 0.35
#HST_FS_100LandVal## is the custom field name
# Redefine Custom Field Rule names to allow mapping to any field name.
PreliminaryTitleOpinion_HST_FS_35LandVal.__name__ = "PreliminaryTitleOpinion_HST_FS_35LandVal##_Value"
If I might toss another question on this about circular references, which don't seem to annoy formulas, but might crush Business Rules. So I have 2 Fields, let's call them Land100## and Land35##. I setup formulas so that a user can enter data in either field and the other one calculates. In super short code they are defined like this.
Code: Select all
Land100##.Value = Land35## / 0.35
Land35##.Value = Land100## * 0.35
So how bad of an idea is that? It does work in formulas, although there is an understandable latent issue the user can get into that remembers values until they are removed by entering a zero in the field. To see the (rather non) issue enter values in both fields, then F2 them out, the previous values remain turning black on the F2, until one of the field is forced to zero. Then it all works again. I'm ok with that, I just don't want to inadvertently cause wasteful loopy behavior with an IronPython Business Rule.
Thanks for the direction!
-Dan