Visibility Base on Contact Name or Type

Questions about and code samples for adding visibility conditions within Select
Post Reply
GWMPCsupport
Posts: 3
Joined: Sat Apr 23, 2016 11:25 am

Visibility Base on Contact Name or Type

Post by GWMPCsupport » Tue Feb 07, 2017 4:46 pm

Can a document's visibility be based on contact name? For example, I would like my closers to only see First American policy documents when the underwriter is First American, etc.

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

Re: Visibility Base on Contact Name or Type

Post by BobRichards » Mon Feb 13, 2017 1:17 pm

Yes. I this case I am filtering on the Underwriter.Name field, but you can use whatever you want (or multiple fields, too).

Code: Select all

return any(u.Name == 'First American' for u in Order.Underwriters)
I would add one more function so the search becomes case insensitive. In this case, the underwriter names are forced to lower case and compared against the target string that has also been manually converted to lower case. This will prevent any upper/lower case entry errors.

Code: Select all

return any(u.Name.lower() == 'first american' for u in Order.Underwriters)
Bob Richards, Software Developer, SoftPro

GWMPCsupport
Posts: 3
Joined: Sat Apr 23, 2016 11:25 am

Re: Visibility Base on Contact Name or Type

Post by GWMPCsupport » Mon Feb 13, 2017 1:49 pm

Thank you Bob! This worked perfectly! :D

GWMPCsupport
Posts: 3
Joined: Sat Apr 23, 2016 11:25 am

Re: Visibility Base on Contact Name or Type

Post by GWMPCsupport » Wed Mar 01, 2017 11:58 am

Hi Bob!

I put in a ticket for assistance with visibility based on contact type but I am not sure the response I got was the most efficient way to implement the visibility conditions. I want a folder to be visible if the seller is an organization. {{Order.Sellers.IndivOrOrg}} is an Organization. The response I got was a visibility code to add to ALL other documents I did NOT want to see if the seller is an organization.

BSTOrg = 32

for seller in Order.Sellers:
if (int(seller.BuyerSellerType) & BSTOrg) > 0:
return True

return False

Rather than add that code to every other document or folder we do NOT want to see. Is there a code that will make a folder visible if the Seller is an Org?

My other questions was visibility based on the {{Order.Sellers.Type}}. The pulldown has various seller types (corporation, LLC, Trust, Estate, etc.). I would like to set up separate folders for each type that are only visible when the corresponding seller type is chosen.

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

Re: Visibility Base on Contact Name or Type

Post by BobRichards » Wed Mar 01, 2017 2:43 pm

In order to get your preferred result, our default would have to be make all folders and files hidden unless there is a Visibility rule to the contrary - that is not the way they work. All files (or preferably folders so you don't have to add visibility rules to every document) that you may wish to hide require a visibility rule. The solution offered with the ticket is correct and the only way to achieve your goal.

As so far as making folder visibility based on the specific BuyerSellerType, this is easily accomplished. In each case, the rule would be modified and added to the folder. Be aware that there are currently around 11 different types so you may either group several types into the same folder or not have folder for them.

Individual:
  • Male
  • Female
  • Joint
Organization:
  • Corporation
  • Limited Liability Corp
  • Limited Liability company
  • Partnership
  • Partnership
  • Trust
  • Estate
  • Other
  • Limited Partnership
Bob Richards, Software Developer, SoftPro

Post Reply