Setting the Trust Account for an order via the API
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Setting the Trust Account for an order via the API
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?
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 82
- Joined: Tue Jan 21, 2014 11:35 am
- Location: Austin, TX
Re: Setting the Trust Account for an order via the API
In both cases, the answer is "yes." What I'm doing is providing a dropdown list to a user with possible trust accounts, the data for which is pulled as such:
The user selects one of these, and the code to set the order to that Trust Account is as such:
I'm also calling ApplyChanges immediately after this, in an outer scope.
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
Re: Setting the Trust Account for an order via the API
So we only have 1 trust account so I wanted to set it directly but this does not appear to be working.
order.SetTag("TrustAccountId", "WICTUSB7743");
should this work ??
Doug
order.SetTag("TrustAccountId", "WICTUSB7743");
should this work ??
Doug
Doug Hamilton
CHICAGO TITLE
20825 SWENSON DR SUITE 300 WAUKESHA, WI 53186
P: 262-796-3808 F: 262-796-3888
EMAIL: Doug.Hamilton@fnf.com
www.wi.ctic.com | www.chicagoagent.com | www.etitle.ws
CHICAGO TITLE
20825 SWENSON DR SUITE 300 WAUKESHA, WI 53186
P: 262-796-3808 F: 262-796-3888
EMAIL: Doug.Hamilton@fnf.com
www.wi.ctic.com | www.chicagoagent.com | www.etitle.ws
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Setting the Trust Account for an order via the API
A TrustAccount.ID is a guid value that we store as a string. You will have to do a lookup of the trust account name to get the guid.
Code: Select all
IAccountsManager accountsManager = SelectServer.GetService<IAccountsManager>();
ITrustAccountInfo trustAccountInfo = accountsManager.TrustAccounts
.Where(x => x.Code == "WICTUSB7743")
.FirstOrDefault();
order.SetTag("TrustAccountId", trustAccountInfo.ID.ToString());
Bob Richards, Senior Software Developer, SoftPro