Get AccountID by AccountNum

Page 1 of 1
4 posts
Get AccountID by AccountNum

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
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?
Re: Get AccountID by AccountNum

omalleypat
MMEX Developer

Posts: 175
Joined: Tue Jul 28, 2009 4:34 pm
Location: Atchison, KS
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.
Re: Get AccountID by AccountNum

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
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?
Re: Get AccountID by AccountNum

madhan
Site Admin

Posts: 242
Joined: Sun Nov 30, 2008 2:06 pm
If you are considering changing the Database schema, please let me know. Thanks.
Page 1 of 1
Who is online

Users browsing this forum: No registered users and 1 guest

cron