tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/3121-alternative-to-getaccountbynameInfinite Kind: Discussion 2020-10-02T12:05:39Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T07:50:22Z2020-10-01T07:50:22ZAlternative to getAccountByName()<div><p>Use AccountBook.getAccountByUUID(String acctID). Moneydance changed the<br>
numbering system I think in version 2015, the getAccountNum() is for<br>
accounts created before. All records within MD have a UUID which is in<br>
the SyncableItem class which all records extend. Account.getUUID()<br>
returns the account's UUID.</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T07:52:56Z2020-10-01T07:52:56ZAlternative to getAccountByName()<div><p>Thanks Mike, that make sense. But now given that I have an Account’s UUID, is there a method I can call to retrieve the account?</p>
<p>So if I know that an Account’s UUID is 123; can I call .getAccountByUUID(123) to return the account? I cannot find such a method?</p>
<p>THanks</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T08:00:43Z2020-10-01T08:00:43ZAlternative to getAccountByName()<div><p>I think I found it....:<br>
AccountUtil.findAccountWithID​(Account root, java.lang.String accountUUID)<br>
Can someone confirm this is OK in conjunction with AccountBook.getAccountByUUID(String acctID).?</p>
<p>(I'm learning that in the API Docs you need to look at the inherited Methods section too!)</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T10:14:05Z2020-10-01T10:14:05ZAlternative to getAccountByName()<div><p>I've confirmed this works. Thanks</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T13:10:53Z2020-10-01T13:10:53ZAlternative to getAccountByName()<div><p>It is on the AccountBook as per my post</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/486813312020-10-01T15:11:35Z2020-10-01T15:11:35ZAlternative to getAccountByName()<div><p>As Mike says, the AccountBook.getAccountByUUID() method is the one to use. If you'd like a permanent reference to any kind of object you can also use the objects .getUUID() method, and use AccountBook.getItemForID(String uuid) to retrieve it again.</p>
<p>Cheers,<br>
Sean</p>
<p>--<br>
Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="https://infinitekind.com">https://infinitekind.com</a></p></div>Sean Reilly