wasTxnDownloaded

davidcullen's Avatar

davidcullen

23 Mar, 2018 02:15 PM

I'm still learning java and python and have a problem with wasTxnDownloaded. The api docs say:
wasTxnDownloaded(AbstractTxn) - Static method in class com.infinitekind.moneydance.model.TxnUtil
Returns true if the given transaction was downloaded, or imported from a downloaded file.
My code is as follows:

from com.infinitekind.moneydance.model import *
import java.util.ArrayList # Keywords are in an ArrayList
import sys
txnset = moneydance.getCurrentAccountBook().getTransactionSet() # all transactions
permittedDescriptions = ["DEFT - KPR"] # permitted descriptions which are not subject to case change
txnsParents = filter(lambda  x:x.class.name == "ParentTxn" and x.getDescription() <> "" and len(x.getDescription()) > 5 and x.getDescription() not in permittedDescriptions and x.getDescription().upper()==x.getDescription(), txnset )
for txn in txnsParents:
print wasTxnDownloaded(txn)
This gives an error message: NameError: name 'wasTxnDownloaded' is not defined
What am I doing wrong?
  1. Support Staff 1 Posted by Sean Reilly on 23 Mar, 2018 03:34 PM

    Sean Reilly's Avatar

    Hi David,

    I think for static methods you'll need to include the name of the class that contains the method, so something like `TxnUtil.wasTxnDownloaded(txn)` should work. Please let me know if it doesn't!

    Thanks,
    Sean

  2. 2 Posted by davidcullen on 24 Mar, 2018 09:41 AM

    davidcullen's Avatar

    Yes, it works! Thanks for your prompt response.

  3. System closed this discussion on 23 Jun, 2018 09:50 AM.

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