Code to Auto fill Title Officer/Examiner in Title Status

Questions about and code samples for custom order rules and validation within Select.
Post Reply
DDeBelle
Posts: 5
Joined: Tue Apr 24, 2018 4:31 pm

Code to Auto fill Title Officer/Examiner in Title Status

Post by DDeBelle » Wed Aug 15, 2018 2:31 pm

Hello,
Can you help me with a code to Auto Fill the Title Officer/Examiner Field in the title status with the same person that marks themselves in the Date/Time Completed/ Completed By: Person in the Schedule A.

When the Title Examiner fills in the Completed by date the system auto fills their name in the "completed by" field, I want this name to auto-pull into the "Title Officer/Examiner" field in the Title Status section too.

BobRichards
Posts: 1006
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Code to Auto fill Title Officer/Examiner in Title Status

Post by BobRichards » Wed Aug 15, 2018 3:34 pm

Here is an example for your first request. Use it as a template for other CORs.

Other things to consider:
  • Be aware that if a user manually enters a Title Officer in the field, then your COR won't run since user entered values have precedence over CORs.
  • Some customer implementations required that users should not be allowed to enter certain field. In this case you can also create a ReadOnly rule to prevent user input. ReadOnly rules do allow CORs and all other ways to update the value.

Code: Select all

from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *

def Title_Officer_Value(args):

    # Initialize identity to value that will clear out the field.
    #   This is the value that we use if we can't find a better one.
    identity = None
    
    # We will use a contact on first Title Insurance Calculation policy.
    #   We are creating a temporary variable to make typing easier on the programmer.
    tic = args.Context.Root.Title.TitleInsuranceCalculations[0]
    
    # If the loan policy exists and has a CompletedBy person, update the identity.
    #   If not, check the owners policy.
    #   If neither has a CompletedBy person then do nothing.
    if tic.LoanPolicy and tic.LoanPolicy.CompletedBy:
        identity = tic.LoanPolicy.CompletedBy
    elif tic.OwnersPolicy and tic.OwnersPolicy.CompletedBy:
        identity = tic.OwnersPolicy.CompletedBy
    
    # At this point, we have an actual CompletedBy person or a value that will
    #   show up as blank when the value of the field is set.
    args.Value = identity
Bob Richards, Software Developer, SoftPro

DDeBelle
Posts: 5
Joined: Tue Apr 24, 2018 4:31 pm

Re: Code to Auto fill Title Officer/Examiner in Title Status

Post by DDeBelle » Wed Aug 15, 2018 5:22 pm

Sorry, I need this for the Commitment Schedule A, rather than the Policy Schedule A

BobRichards
Posts: 1006
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Code to Auto fill Title Officer/Examiner in Title Status

Post by BobRichards » Thu Aug 16, 2018 10:59 am

Please consider this an exercise for the reader. We are unable to write custom scripts for developers in this forum. The purpose of the forum is to provide examples, best practices, and techniques to interact with Select.

Try and use the provided code as an example to modify for your specific circumstance. If you have specific questions about your code as you develop it, please submit them. If you need SoftPro to develop custom CORs for your organization, please contact your SoftPro customer service representative for design services.

Good luck!
Bob Richards, Software Developer, SoftPro

Post Reply