Get AccountID by AccountNum

Money Manager Ex Development related posts
(http://github.moneymanagerex.org/)

Moderator: Renato

Post Reply
elliswr
MMEX Developer
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Get AccountID by AccountNum

Post by elliswr »

I'm working on the OFX import, and I need to get the account before I can add transactions to it, but the OFX file will not contain the accountID or the accountName. It does have the accountNumber so I was hoping to get the account with that, and then if the account didn't have an account number have the user select the account manually. Then I could add the accountNum to the account once the user has identified the proper account.

The only problem is that I don't see a way to get the accountID based on the AccountNum. How would I do this?
omalleypat
MMEX Developer
Posts: 112
Joined: Tue Jul 28, 2009 10:34 pm
Are you a spam bot?: No
Location: Atchison, KS

Re: Get AccountID by AccountNum

Post by omalleypat »

Do you mean what SQL query do you need?

Code: Select all

SELECT ACCOUNTID FROM ACCOUNTLIST_V1 WHERE ACCOUNTNUM LIKE 1234567890
I think you'd want to add a function to dbwrapper.cpp to use this query so you pass it the account number and have it return the account ID.
elliswr
MMEX Developer
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Get AccountID by AccountNum

Post by elliswr »

Thanks Pat. I probably will end up adding that to the dbwrapper.ccp. Also, I am thinking about adding a new member to the mmTransaction class called fi_id (financial institution identification). This would be very useful for imports from OFX files, as it can be used to prevent duplicate transaction imports. The fi_id is a unique id assigned to each transaction by the financial institution. So when we import OFX files, we check to see if that fi_id already exists in our database, and if it is, skip that transaction. This would be an invisible field (not in any dialogs, reports, etc), and would not be accessible by the end user. Does anyone object to this?
madhan
Site Admin
Posts: 99
Joined: Sun Nov 30, 2008 8:06 pm

Re: Get AccountID by AccountNum

Post by madhan »

If you are considering changing the Database schema, please let me know. Thanks.
Post Reply