Visibilty Conditions Examples

Questions about and code samples for adding visibility conditions within Select
Post Reply
slind
Posts: 8
Joined: Thu Nov 13, 2008 1:59 am
Location: Cincinnati, Ohio

Visibilty Conditions Examples

Post by slind » Tue Jul 11, 2017 2:40 pm

I sent this in to support, but they are probably just going to direct me here.

May I please get examples on the syntax for the following:

1. If Property State = “KY”
2. If Property State in [“IN”, “KY”, “OH”]
3. If Property State = “KY” or “Null” (or blank)
4. If Lender Lookup Code = “ABC”
5. If Custom Underwriter Field {{602-512UndCode##}}=”FA-KY”
6. If Transaction Type = “Purchase”

Thanks!
Stephanie

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

Re: Visibilty Conditions Examples

Post by BobRichards » Tue Jul 11, 2017 5:37 pm

1. If Property State = “KY”

Code: Select all

# Get state for first property.
state = Order.Properties[0].Address.State

# Return True if there is a state object and it matches.
return state and state.Code == 'KY'
2. If Property State in [“IN”, “KY”, “OH”]

Code: Select all

# Get state for first property.
state = Order.Properties[0].Address.State

# Return True if there is a state object and it matches.
return state and state.Code in {'IN', 'KY', 'OH'}
3. If Property State = “KY” or “Null” (or blank)

Code: Select all

# Get state for first property.
state = Order.Properties[0].Address.State

return (state is None
		or state.Code == 'KY'
		or not state.Code)
4. If Lender Lookup Code = “ABC”

Code: Select all

# Get first lender.
lender = Order.Lenders[0]

# Return True if there is a lender and the lookup code matches.
return lender and lender.LookupCode == 'ABC'
5. If Custom Underwriter Field {{602-512UndCode##}}=”FA-KY”

Not currently possible since it would require the IOrderItem interface that is not available here and you can't import.

6. If Transaction Type = “Purchase”

Code: Select all

# I hate converting enums to strings for comparison, but the library for resolution
#    is not available here and you can't import.
return str(Order.TransactionType) == 'Purchase'
Bob Richards, Software Developer, SoftPro

slind
Posts: 8
Joined: Thu Nov 13, 2008 1:59 am
Location: Cincinnati, Ohio

Re: Visibilty Conditions Examples

Post by slind » Wed Jul 12, 2017 10:47 am

Thank you so much! This helps so much. My users are going to be so happy as we do business in three states with four different Underwriters so our trees are kind of crazy.

We have the custom Underwriter field because we were told that we should not change the Underwriter lookup codes because you guys do something in the background with it. So First American needed to stay "FA" etc. Since we do business in three states we needed to break our underwriters down further so we made a custom field that is "FA-KY", "FA-OH", "FA-IN" etc. for all our underwriters. I would like to trim down the Document tree and only show the Underwriter/State that fits the file.

I guess I could do an "AND" statement to check the underwriter and the state in a file. (Can you please help me with the syntax for an "AND" statement? I tried the following on one of the First American folders and the folder still displays even if it isn't First American. What do I have wrong?

return any(u.Name == 'First American Title Insurance Company' for u in Order.Underwriters)

slind
Posts: 8
Joined: Thu Nov 13, 2008 1:59 am
Location: Cincinnati, Ohio

Re: Visibilty Conditions Examples

Post by slind » Wed Jul 12, 2017 12:19 pm

I actually tried
# Get state for first property.
state = Order.Properties[0].Address.State

# Return True if there is a state object and it matches.
return state and state.Code == 'KY'

On the Underwriter folder for First American KY and it still displayed on other states. That logic is working great on all my Kentucky documents in my User Document Tree. Is there something special about the Underwriter folders that prohibits the Visibility Conditions from running? I couldn't find any specific rights tied to them.

I also noticed that you guys have started to add Visibility Conditions to a few of your documents (CDF/HUD etc.), it would be great if you would just by default include the visibility condition of Underwriter/State on the Underwriter Bundles. Thank you for all your help, I really appreciate it!

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

Re: Visibilty Conditions Examples

Post by BobRichards » Thu Jul 13, 2017 8:35 pm

There is nothing special about any folder. Select client will have the old visibility rule in memory, though, so you may want to try closing the Documents window.
Bob Richards, Software Developer, SoftPro

Post Reply