Page 1 of 1

Setting State on a new order

Posted: Mon Feb 12, 2024 4:16 am
by dn_garza
StateCode.png
StateCode.png (76.99 KiB) Viewed 1216 times


Is there a way, after casting an order to a dynamic object, to set 'State' on an address as in the screenshot provided?

Re: Setting State on a new order

Posted: Mon Feb 12, 2024 10:38 am
by BobRichards
States (like several others types) inherit from IValueType.

Code: Select all

// Get IState object.
IEnumManager enumMgr = ss.GetService<IEnumManager>();
IState state = enumMgr.GetEnum<IState>().Values.Where(t => t.Code == "TX").First();

...
o.SettlementLoction.Place.Address.State = state;