Open a typical order then open the Field Code Browser (FCB). Now open the Order.Buyers collection, look for the "BuyerSellerType" property. Click on it and you will see the property Type in the bottom panel of the screen. It shows that the type is "BuyerSellerType". If you look up this type in the SoftPro Select SDK Documentation Help (installed when you install the Select SDK and located in Start -> SoftPro Select SDK -> SoftPro Select SDK), you will see the following information.
2021-11-09_13-44-49.png (54.97 KiB) Viewed 5130 times
To use it in a COR, you must include the assembly that holds the BuyerSellerType information at the top of the COR file. Then you must set the property to a value that is of type BuyerSellerType (not with a string type as you originally did). You got the error because you were passing a string to the property - not a BuyerSellerType object that it was expecting.
from SoftPro.OrderTracking.Client.Orders import *
...
newby1.SetProperty("BuyerSellerType", BuyerSellerType.Individual); // This line used to cause an error.
Thanks, that worked. Now, for the same code above, I get an error when trying to enter the state into an address. How do I enter the state? Cannot find the information in the SDK.
Unfortunately the SDK will never have all the information. I wish it did. You can search this DevForum for keywords also. You might find clues where others have asked similar or even unrelated questions - the same way you did it in September: HUD Section 1200 See how "search.State" was set by looking up the State abbreviation.
(How did I find it?) Since "state" is too common a word, I looked in the FCB and saw that "state" was of type "IState". When I searched on "IState" in the DevForum, I found multiple examples. As always, it's about figuring out what keyword to search for.
To clarify, if you know the state and want to set an Address object with it, use the example below. First I get the IState object that represents the state you are looking for. In this case I am searching for Texas. Next I get a contact as an example of an object with an Address and set the state.
// Get IState object.
IEnumManager enumMgr = ss.GetService<IEnumManager>();
IState state = enumMgr.GetEnum<IState>().Values.Where(t => t.Code == "TX").First();
// Get first settlement agent and set the state to TX
IOrderItem settlementAgent = ((IList)order.GetProperty("SettlementAgents"))[0] as IOrderItem;
IOrderItem address = settlementAgent.GetProperty("Address") as IOrderItem;
address.SetProperty("State", state);
Thanks Bob, it took some digging and analyzing but I finally figured that out. I now have a good understanding of how to communicate with the API. Everything seems to have fallen into place and is making sense. I had one other question though and have entered it in a new post.