How do you add tags to a transaction
I'm trying to find documentation on how tags are added to the parent and split transaction types. I'm using makeParentTxn and makeSplitTxn. I found reference to legacy tags but that sounds like it is an old way of doing things. Can anyone point me in the right direction. Thanks
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Sean Reilly on 25 May, 2020 07:43 PM
Hi Bob,
I think the method you want is setKeywords(List), which is tricky to find because it's in the superclass of the transaction classes:
https://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mod...
Thanks!
Sean
--
Sean Reilly
Developer, The Infinite Kind
https://infinitekind.com
2 Posted by Bob B on 28 May, 2020 01:30 AM
ThanksI've got it now.
3 Posted by Max Pixel on 11 Jun, 2020 06:14 AM
I had tried adding a keyword by using
getKeywords().add(...)
, but ended up with the tag repeated numerous times. Given that I was creating transactions inside of a loop, I suspect this is because callinggetKeywords()
on a newly created transaction returns some sort of recycled List instance. CallingsetKeywords
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.Support Staff 4 Posted by Sean Reilly on 11 Jun, 2020 09:18 AM
Yes, that getKeywords method should be returning an immutable list. Thanks, I'll sort that out!
--
Sean Reilly
Developer, The Infinite Kind
https://infinitekind.com
System closed this discussion on 10 Sep, 2020 09:20 AM.