Re: Setting the Trust Account for an order via the API
Posted: Thu Dec 12, 2019 11:14 am
If you open the order via API, does the "TrustAccountId" tag exist in the Order object's tag collection? Is the guid value a valid trust account?
Free support for custom code within SoftPro's products, monitored by SoftPro employees with a 24-48 hr expected turn time on business days.
https://devforum.softprocorp.com/
Code: Select all
var accountsManager = SelectServer.GetService<IAccountsManager>();
var trustAccounts = accountsManager.TrustAccounts
.Where(x => x.Enabled)
.ToList();
Code: Select all
order.SetTag("TrustAccountId", TrustAccount.ID.ToString()); // TrustAccount is the user-select Trust Account object here
Code: Select all
IAccountsManager accountsManager = SelectServer.GetService<IAccountsManager>();
ITrustAccountInfo trustAccountInfo = accountsManager.TrustAccounts
.Where(x => x.Code == "WICTUSB7743")
.FirstOrDefault();
order.SetTag("TrustAccountId", trustAccountInfo.ID.ToString());