tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/1851-delete-an-accountInfinite Kind: Discussion 2017-11-19T11:36:27Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/425481092017-05-12T21:14:25Z2017-05-12T21:14:25ZDelete an account<div><p>Hi David,</p>
<p>Ah yes, in order to delete an account you'll need to call the .deleteItem() method on that account. Please make sure that there are no transactions (including in reminders) or subaccounts that may still refer to that account though.</p>
<p>Thanks!</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/425481092017-05-13T17:24:37Z2017-11-19T11:36:27ZDelete an account<div><p>Thanks Sean,<br>
The .deleteItem() works, but unfortunately doesn't delete its' subaccounts.<br>
I'm migrating from Quicken and want to delete the default accounts and<br>
categories. I can iterate through them though.</p>
<p>So is the documentation for .removeSubAccount() wrong, or what?</p>
<p>Kind regards,</p>
<p>David Read.</p></div>davidreadtag:infinitekind.tenderapp.com,2009-01-14:Comment/425481092017-05-21T09:08:59Z2017-05-21T09:08:59ZDelete an account<div><p>Hi David,</p>
<p>Ah yes, that method is not public so it's not supposed to be exposed, however that doesn't matter to the Python interface as it uses reflection to find and invoke methods. That method also shouldn't be appearing in the API documentation, but I believe it does have a "caution" note in it to indicate that orphan transactions (not to mention accounts) could result as it's supposed to be a behind the scenes method used for keeping the account hierarchy up-to-date.</p>
<p>From the Python API there is a non-published method that I can't see us changing anytime soon that you could use:</p>
<p>moneydance.getUI().deleteAccountAndAllReferences(Account account_to_delete);</p>
<p>There is no GUI confirmation on it, but it will delete the given account and all references, including sub-accounts/categories, transactions, reminders, etc.</p>
<p>Thanks!<br>
Sean</p></div>Sean Reilly