I keep a bunch of handy code fragments here so I don’t lose them. They are in no particular order.
IEnumManager – Get IState, IBillCode, and Many Others
You must use IEnumManager to get literally dozens of values that are come from lists that are either maintained inside Select (like IState) or are user editable (such as Bill Code values in the SPAdmin Drop-down Lists). The technique is the same.
from SoftPro.Select.Client.Enumerations import * # Set address state to North Carolina. enumMgr = order.GetService(IEnumManager) states = enumMgr.GetEnum[IState]() state = next(t for t in states.Values if t.Code == "NC") address.State = state # Works for Bill Codes too. enumMgr = order.GetService(IEnumManager) bcs = enumMgr.GetEnum[IBillCode]() bc = next(t for t in bcs.Values if t.Code == "END") charge.BillCode = bc