Select allows you to write expressions that can show or hide documents and reports from a potentially large list of order reports. This is very handy since it allows you to filter out reports that are not relevant to the order (hides HUD-1 reports if the order is a CDF) or to the user that has the order open (different users have different functions). This functionality is achieved with short Python scripts.
It’s important to make these scripts short so they execute quickly and have a snappy user response since some customer implementations have large numbers of documents and reports.
Runtime Dictionary
Properties | |
Order | The order object |
Methods | |
IsCurrentUserMemberOfGroup (group) | Return True if the current user is a member of the specified group. |
Implementation Details
If only a single line is entered (without an initial return), then the line is executed and the resulting boolean is returned to Select.
If more than one line of code is entered or only one line starting with return, the code is functionally inserted within the following construct then executed.
def func(): {insert user visibility code fragment} # Return boolean to Select. return func()
Visibility code cannot contain additional methods (def), classes (class), import, or from statements. If these are detected, Select will throw an Invalid syntax error.
Default Runtime Assemblies
The following assemblies are loaded by Select into the runtime environment. You can only use classes contained in them since you are not allowed to add additional assemblies to Visibility Conditions.
- System.Core
- SoftPro.ClientModel
- SoftPro.Select.Client
- SoftPro.OrderTracking.Client
Examples
# Group names are case sensitive! return IsCurrentUserMemberOfGroup('TitleOfficer')
# Only show if there is a Property in Georgia - "GA" return any(prop.Address.State.Code == 'GA' for prop in Order.Properties)
# Only show when the profile is Default\Region\South\Raleigh return Order.OwnershipProfile.Path == 'Default\\Region\\South\\Raleigh'
# Alternately, only show if profile begins with a fixed phrase. # Use this to break documents/folders into territories or job functions. path = Order.OwnershipProfile.Path return path.startswith('Default\\Region\\South')
# Hide document unless order is CDF settlement type. SettlementType_CDF = 0 SettlementType_HUD1 = 1 SettlementType_CSS = 2 return int(Order.SettlementType) == SettlementType_CDF
# Make document visible if order has property in one of the "ValidStates". # List of all states that should allow document to be visible. ValidStates = ["NC", "SC"] for prop in Order.Properties: # Make sure state "Code" exists. if (prop.Address is None or not str(prop.Address.State)): # Not a valid state. Go to next property. continue # We have a value like "NC". Return True if in our list. if str(prop.Address.State) in ValidStates: return True # No order properties in our list of valid states. return False