InvestFields - trying to enter non-security expense

Bob B's Avatar

Bob B

01 Jun, 2020 07:02 PM

I'm trying to use InvestFields to create a transaction for an investment account that is not security related - an expense for an account fee.
The transaction always ends up as income and not expense.

I'm using transaction type of InvestTxnType.BANK
I'm setting the xfrAcct field to the Category account (an expense type category). I've tried setting negateCategory but that does nothing.

I tried setting the Category field, but that just ends up with the default category being set instead of the one I entered.

Any ideas?

NOTE: I can get the correct behaviour if I don't bother with InvestFields and just treat this as a parent with a split to the expense category (makeParent and makeSplit). I just negateAmount() on the split and everything looks fine. I'm trying to use InvestFields since that seems to be the recommended way of dealing with investment transactions. But maybe InvestFields are not intended for this purpose..

PS> I do appreciate the help. I am documenting everything that I figure out with respect to how to do different transaction types and I will post that in this forum to help others when I am done.

  1. 1 Posted by Bob B on 13 Jun, 2020 04:11 AM

    Bob B's Avatar

    I have come to the conclusion not to use InvestFields for this purpose. Using makeParent and makeSplit seem to work fine for non-security based investment transactions.

  2. Support Staff 2 Posted by Sean Reilly on 13 Jun, 2020 11:18 PM

    Sean Reilly's Avatar

    Hi Bob,
    Sorry for not responding earlier, but I do agree that for non-security transactions it is preferably to record a "normal" transaction by making the ParentTxn and SplitTxns yourself.


    Sean Reilly
    Developer, The Infinite Kind

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? 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