Visibility Based on Seller Type

Questions about and code samples for adding visibility conditions within Select
Post Reply
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Visibility Based on Seller Type

Post by kendale.wyatt »

Can I please get the syntax for the following two situations?

If Seller Type = "Individual"
If Seller Type = "Organization"

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

Re: Visibility Based on Seller Type

Post by BobRichards »

Under the covers, the BuyerSellerType is a bitwise enumeration that allows you to use a math trick to determine if the buyer or seller is of type Individual or Organization.

Code: Select all

# Determine if buyer is an organization...
bool isOrganization = (buyer.BuyerSellerType & BuyerSellerType.Organization) == BuyerSellerType.Organization

# Determine if seller is an individual...
bool isIndividual = (seller.BuyerSellerType & BuyerSellerType.Individual) == BuyerSellerType.Individual
Bob Richards, Senior Software Developer, SoftPro
Post Reply