tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2789-how-do-you-add-tags-to-a-transactionInfinite Kind: Discussion 2020-09-10T09:20:22Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/483598212020-05-25T19:43:01Z2020-05-25T19:43:01ZHow do you add tags to a transaction<div><p>Hi Bob,</p>
<p>I think the method you want is setKeywords(List), which is tricky to find because it's in the superclass of the transaction classes:<br>
<a href="https://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/model/MoneydanceSyncableItem.html#setKeywords(java.util.List)">https://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mod...</a></p>
<p>Thanks!<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 Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/483598212020-05-28T01:30:21Z2020-05-28T01:30:21ZHow do you add tags to a transaction<div><p>ThanksI've got it now.</p></div>Bob Btag:infinitekind.tenderapp.com,2009-01-14:Comment/483598212020-06-11T06:14:31Z2020-06-11T06:14:31ZHow do you add tags to a transaction<div><p>I had tried adding a keyword by using <code>getKeywords().add(...)</code>, but ended up with the tag repeated numerous times. Given that I was creating transactions inside of a loop, I suspect this is because calling <code>getKeywords()</code> on a newly created transaction returns some sort of recycled List instance. Calling <code>setKeywords</code> with a new list works, but the behavior I encountered indicates to me that something under the hood is implemented in an undesirably risky way.</p></div>Max Pixeltag:infinitekind.tenderapp.com,2009-01-14:Comment/483598212020-06-11T09:18:48Z2020-06-11T09:18:48ZHow do you add tags to a transaction<div><p>Yes, that getKeywords method should be returning an immutable list. Thanks, I'll sort that out!</p>
<p>--<br>
Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="https://infinitekind.com">https://infinitekind.com</a></p></div>Sean Reilly