Define Assignment CORs - Reference not working
Posted: Mon Aug 21, 2023 5:08 pm
I'm attempting to write CORs for custom fields that I have on assignments however I'm having an issue with CORs not being able to find the Assignment context. I'm using the standard <Context>_<Field>_<Aspect> format.
The simplest version of the code that is not working:
I'm getting the blue underlines on all of the function definitions and they are not functioning. I have tried both Assignment and Assignments. I have no issue creating CORs for other fields or even for AssignmentParty (example below that works).
Below is the broader context of what I'm attempting to get to work. Everything is working except the assignment custom field.
I did see in a thread from 2021 the possibility that custom fields with underscores could cause issues but I'm not seeing that with my other custom fields and I'm seeing the issue on the two fields with assignment as a parent. viewtopic.php?p=6120
Please let me know if you need screenshots or any additional information.
The simplest version of the code that is not working:
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def Assignment_ConsiderationAmount_Value(args):
args.Value = 1000
def Assignment_ConsiderationAmount_Validate(args):
args.RaiseWarning("ConsiderationAmount")
def Assignment_InterestFromDate_Validate(args):
args.RaiseWarning("InterestFromDate")
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def AssignmentParty_Name_Validate(args):
args.RaiseWarning("AssignmentParty")
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def ExistingLien_InstrumentTypeUA_Value(args):
if (args.Context.InstrumentType.Code == "CEMA"):
args.Value = "CONSOLIDATION, EXTENSION AND MODIFICATION AGREEMENT"
elif (args.Context.InstrumentType.Code == "EMA"):
args.Value = "EXTENSION AND MODIFICATION AGREEMENT"
elif (args.Context.InstrumentType.Code == "MOD"):
args.Value = "MODIFICATION AGREEMENT"
else:
args.Value = args.Context.InstrumentType.Description
def Assumption_InstrumentTypeUA_Value(args):
if (args.Context.AssumptionModification.IsOther):
if (args.Context.InstrumentType.Code == "CEMA"):
args.Value = "CONSOLIDATION, EXTENSION AND MODIFICATION AGREEMENT"
elif (args.Context.InstrumentType.Code == "EMA"):
args.Value = "EXTENSION AND MODIFICATION AGREEMENT"
elif (args.Context.AssumptionModification.IsModification):
args.Value = "MODIFICATION OF " + IOrderItem.GetProperty(args.Context, 'InstrumentType_UA##').upper()
elif (args.Context.AssumptionModification.IsAssumption):
args.Value = "ASSUMPTION OF " + IOrderItem.GetProperty(args.Context, 'InstrumentType_UA##').upper()
else:
" OF " + IOrderItem.GetProperty(args.Context, 'InstrumentType_UA##')
def Assignment_InstrumentTypeUA_Value(args):
""" Set InstrumentType_UA# custom field value to InstrumentType.Description """
args.Value = "ASSIGNMENT OF " + IOrderItem.GetProperty(args.Context.Parent, 'InstrumentType_UA##')
# Redefine Custom Field Rule names to allow mapping to any field name.
# This should be at the bottom of the file.
ExistingLien_InstrumentTypeUA_Value.__name__ = "ExistingLien_InstrumentType_UA##_Value"
Assumption_InstrumentTypeUA_Value.__name__ = "ExistingLien_Assumption_InstrumentType_UA##_Value"
Assignment_InstrumentTypeUA_Value.__name__ = "Assignment_InstrumentType_UA##_Value"
Please let me know if you need screenshots or any additional information.