Quickbooks Data Schema? - database

I'm trying to develop a simple app for my staff to log their time and expenses on a remote (access) db, and then sync that with QuickbooksPro. I have managed to get QBFC to work, my problem now is understanding the underlying database structure (field names etc) in Quickbooks - e.g. so I know which elements to add to queries etc.
I have found the following (EntityRef, CustomerRef) by trial and error, and by looking at a table pulled using QOBDC; however, there must be documentation of this somewhere - anyone know where?
TimeDataQry.IncludeRetElementList.Add("EntityRef")
TimeDataQry.IncludeRetElementList.Add("CustomerRef")
TimeDataQry.IncludeRetElementList.Add("TxnDate")
TimeDataQry.IncludeRetElementList.Add("BillableStatus")
TimeDataQry.IncludeRetElementList.Add("Duration")
TimeDataQry.IncludeRetElementList.Add("TimeModified")

to be honest, the actual QB data schema is horrible - huge and confusing. It's not worth trying to figure out how to interact directly with their API. That's one of the reasons people like QODBC created simpler ways to interact with it. Have you purchased QODBC?
I've created apps using QODBC and RSSBus, and I like RSSBus better. There are many reasons, but for starters, QODBC is actually a driver that uses DNS's, which can be confusing and have to be set up on each computer that you want to use this on whereas RSSBus does not have any of that. What QODBC and RSSBus do is wrap the QB db in a sort of sqlserver-like db, so any table structures you pull from the QODBC tool will most likely have no correlation to anything you could use through QBFC.
I prefer RSSBus now, but here are links to documentation for both:
RSSBus - http://www.rssbus.com/kb/help/RQR3-A/pg_imetracking.rst
QODBC - http://doc.qodbc.com/qodbc/Qodbc_20_us.html
Also, this SO question may help - QuickBooks QBFC explanation. Notice that he says there are 300+ pages of documentation for this. A little too much imo.

Use the QuickBooks OSR (it works best in Chrome):
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
Choose the request/object type you're dealing with from the "Select Message" drop-down, and click on any of the nodes to view documentation on the node.
For example, what you posted above looks like you're looking at Time Tracking entries. Here's what you get from the OSR about EntityRef:
Entity
A QuickBooks "entity" is a customer, vendor, employee, or
person on the QuickBooks "other names" list. Special cases to note:
In a BillToPayQuery message, EntityRef refers to the vendor name.
In
JournalCreditLine and JournalDebitLine messages for A/R accounts,
EntityRef must refer to a customer, or else the transaction will not
be recorded. For A/P accounts the EntityRef must refer to a vendor, or
else the transaction will not be recorded.
In a TimeTracking message,
EntityRef cannot refer to a customer, only to an employee, vendor, or
person on the "other names" list whose time is being tracked.
Pretty simple, pretty detailed.
It's also worth noting that the QuickBooks APIs almost exactly mirror the QuickBooks GUI. For example, when creating an invoice in the QuickBooks GUI, you'll see fields like:
Customer
Date
Invoice #
Item
PO Number
And then if you look at InvoiceAdd in the API, you'll find these fields:
CustomerRef
TxnDate
RefNumber
ItemRef
PONumber
It shouldn't be terribly difficult to put two and two together and figure out that these fields match the fields presented in the GUI.

Here is the QODBC documentation on table schemas:
All Tables.
If you want specific US related table groupings like Customer and AR then check here:
Tables by Group

Related

Where to find already filled in databases

I am new to using external databases, and i was wonderding if there might be a place with many "common"databases?
I know db can be very product specific but i'm talking about like:
Car brand + model
Food + nutrisious values
...
(Common stuff)
Database structure varies with requirements so you may not find what you need exactly but however, if you just need sample databases, then try Google search.
Make sure you don't use any of those for a real time projects.

Using FKs to find the shortest path between two columns in the database

I'm currently working on a project where the data graph is very confusing. For example if you want to find the region to which a contract will be applied, instead of just
having a FK for the region in the Contract table, you will only have a FK of the agency who is in charge of monitoring the contract, then from that table you will link to the
department of your company who is in charge of dealing with that agency, then from that department you will move toward the business unit ID, then from the Business Units table
you will eventually find a FK to the region you're interested in.
This is a real pain, because in addition to this, the business logic is implemented in the database and it is an industry which is quite complicate.
So when developing, we are dealing with two complexities : finding our data, and understanding the business logic.
Understanding the data graph actually requires to have a very good understanding of the domain. I know and I agree that every developer should understand the domain on which he is working,
but here it's a very a huge task. We are talking about a regulated industry, with a lot of specific rules.
And with the example I've given, you can see that even if you are working
on the Contract Creation module, you can't just say : well, I'll go ahead and study deeply the domain for that part, because when it comes to finding the region, you'll eventually need to know that you will find it at the other part of the data graph.
And it was really just an example, the real entities are much less intuitive than that.
I had an idea yesterday. Since in SQL Server we have access to the schema of all the database, I would like to write a script that would take 2 arguments :
-The Table StartPoint's Name
-And the Column name we are after.
And it would return a "graph" of all the paths that are possible to access it.
Is it an easy task to do, and how would you go about it ? (I am not an SQL Server expert)
It would be a fairly large task for me to write this out, but if you create a recursive CTE, using sys.foreign_keys and sys.foreign_key_columns, you could accomplish this. I think this post, Traverse through all foreign keys in database and generate a path , or this one, https://social.msdn.microsoft.com/Forums/sqlserver/en-US/66f379e1-32bc-44cb-bb48-93f42993ba23/is-there-a-way-to-determine-the-order-in-which-you-need-to-perform-deletes-when-there-using-a?forum=transactsql , is close to what I'm picturing, and then just applying a WHERE filter.

How do I structure multiple Identity Data in a database

Am designing a database for a credit bureau and am seeking some guidance.
The data they receive from Banks, MFIs, Saccos, Utility companies etc comes with various types of IDs. E.g. It is perfectly legal to open a bank account with a National ID and also a Passport. Scenario One that has my head banging is that Customer1 will take a credit facility (call it loan for now) in bank1 with the passport and then go to bank2 and take another loan with their NationalID and Bank3 with their MilitaryID. Eventually when this data comes from the banks to the bureau, it would be seen as 3 different people while we know that its actually 1 person. At this point, there is nothing we can do as a bureau.
However, one way out (for now) is using the Govt registry which provides a repository which holds both passports and IDS. So once we query for this information and get a response, how do I show in the DB that Passport_X is related to NationalID_Y and MilitaryNumber_Z?
Again, a person's name could be captured in various orders states. Bank1 could do FName, LName, OName while Bank3 can do LName, FName only. How do I store this names?
Even against one ID type e.g. NationalID, you will often find misspellt names or missing names. So one NationalID in our database could end up with about 6 different names because the person's name was captured different by the various banks where he has transacted.
And that is just the tip of the iceberg. We have issues with addresses, telephone numbers, etc etc.
Could you have any insight as to how I'd structure my database to ensure we capture all data from all banks and provide the most accurate information possible regarding an individual? Better yet, do you have experience with this type of setup?
Thanks.
how do I show in the DB that Passport_X is related to NationalID_Y and MilitaryNumber_Z?
Trivial.
You ahve an identity table, that has an AlternateId field if the Identity is linked to another one. Use the first IDentity you created as master. Any alternative will have AlternateId pointing to it.
You need to separate the identity from the data in it, so you can have alterante versions of it, possibly with an origin and timestampt. You need oto likely fully support versioning and tying different identities to each other as alternative, including generating a "master identity" possibly by algorithm with the "official" version of your data (i.e. consolidated).
The details are complex - mostly you ahve to make a LOT of compromises without killing performance, so at the end HIRE A SPECIALIST. There is a reason there are people out as sensior database designers or architects that have 20+ years experience finding the optimal solution given the constrints you may not even be aware of (application wise).
Better yet, do you have experience with this type of setup?
Yes. Try financial information. Stock symbols / feeds / definitions are not necessariyl compatible and vary by whom you get it. Any non-trivial setup has different data feeds that may show the same item slightly different, sometimes in error. DIfferent name, sometimes different price (example: ES, CME group, is 50 USD per point, but on TT Fix it is 5 - to make up, the price is multiplied by 10, so instad of 1000.25 you get 10002.5). THis is the same line of consolidation, and it STINKS.
Tons of code, tons of proper database design, redoing it half a dozen time to get the proper performance. THis is tricky, sadly.

Relational database data explorer / visualization?

Is there a tool that can let one browse relational data as a graph of connected nodes?
For example, i'm faced with trying to cleanse some anomolous data. i can start with two offending rows. In this particular example, the TransactionID should, by business rules, be unique to the table, but i find a transaction that violates that rule:
SELECT * FROM LCTTrans
WHERE TransactionID = 1075048
LCTID TransactionID
========= =============
4358 1075048
4359 1075048
2 row(s) affected
But really what i want to begin to hunt down all the related data, to try to see which is right. So this hypothetical software would start by showing me these two rows:
Next, i want to see that transaction that is linked into this table:
Now that transaction points to an MAL, so show me that:
Now lets add those two LCTs, that the transaction is "on". A transaction can be on only one LCT, yet this one is pointing to two:
Okay computer, both of those LCTs point to an MAL and the transaction that created them, show me those:
Those last two transactions, they also point at an MAL, and they themselves point to an LCT, show me those:
Okay, now are there any entries in LCTTrans that point to LCTs 4358 or 4359?...
And so on, and so on.
Now i did all this manually, running single selects, copying and pasting uniqueidentifier keys and converting them into friendly id numbers so i could easily see the relationships.
Is there software that can do this?
Ok, well I liked this idea so much that I've written it.
It's not released yet, but when it is it will be free.
Edit
Ok, it's now released. Free relational database exploring goodness # http://www.atlantis-interactive.co.uk/products/datasurf/default.aspx
Edit
Although initially free, this is now part of Pragmatic Works' DBA xPress package.
DBeauty is a powerful data browser (similar to Matt Whitfield's excellent DataSurf but more powerful). It is Java based, so you need to download the JDBC driver. I've found this tool invaluable in quickly navigating data (I fell in love with Microsoft's Quadrant before they killed it off and have been looking for a replacement ever since).
Old but good and free DB subsetting tool Jailer should be able to answer the question.
http://jailer.sourceforge.net/
Yes, i would advice you to look into DbSchema, it's a neet database management tool that will help you.
I can think of a few for relational data (RDF, Topic Map and conceptual graph browsers), but none off-hand for SQL. You could try and translate your queries to a relational language the browsers understand. You also might be able to build something on top of skyrails. Most of the visualisations I've tagged on delicious are for graph or relational data, but again tend to be schema free rather than SQL.
Basically you write a dedup tool where you show both records onthe screen side by side with the ability to pick the record you wan to keep but to check individual data from the other record to keep as well. Since deduping is very differnt from database to database and highly dependant on the specific table structure and business rules you have (as well as knowledge about which things must be looked at for the type of deduping you are doing as they typically only show the most important relationship tables on screen), I have never seen one that wasn't built in house.
But if you want a quick look at all the data write a query that left joins to all the child tables and shows all the fields for both transactionids. Then read through your results.
More importantly, how did you end up with a dup if you hav ea business rule that requires the transactionid to be uninique. Did you forget that all of these types of rules must be enfoced through the datbase and not the application? Why was there no unique index on that field?
I've looked for open source software that can do this sort of link analysis, without much success. If you have enough of a budget to go proprietary, you might consider talking to Palantir Technologies, Centrifuge Systems, i2, etc. about analytics platforms and visualization technologies.
Try This tool - it is in russian, but interface is comprehensive http://sourceforge.net/projects/basescan/. Navigation in base is through drag and drop.

Learning to query UniData

We have an IBM UniData server. I just installed UniObject .net. It looks like you just issue unidata queries through the .net classes.
Where can I learn the query language/syntax and to work with UniData in general? What books, sites, or videos do you recommend?
The best resource is going to be Rocket Software's UniData library.
Rocket recently acquired the U2 family of products, which includes UniData and UniVerse, from IBM. They've got a pretty extensive catalog of documentation for UniData. You might want to check out the "Using UniQuery" document, which discusses the UniQuery in particular.
Unfortunately, you won't find many books, screencasts, or programming communities devoted to UniData because it's pretty esoteric. If you run into anything specific that you've got questions on, it can't hurt to post here using the UniData tag and I'll do my best.
You can find a lot of information on the U2UG (U2 User Group). There is a learner pack:
http://212.241.202.162/cms/cmsview.wsp?id=learner_pack
This will help.
International Spectrum has webinars that cover the Query language, and can put in touch with a trainer if you are interested:
http://www.intl-spectrum.com/
Besides the Using UniQuery document, the UniQuery Commands Reference is also useful.
The general structure of the query is
verb table filter order display
SORT CUSTOMER IF HATSIZE = "7" BY SHOESIZE NAME CITY STATE ZIP
Where
verb = SORT
table = CUSTOMER
filter = IF HATSIZE = "7" (you can have multiple filters
order = BY SHOESIZE (you can have multiple order elements)
display = ID NAME CITY STATE ZIP (ID isn't on the list, but it is implied)
For this to work, the TABLE (also called a FILE) named CUSTOMER has to exist.
CUSTOMER must have a dictionary (schema/view repository) which defines HATSIZE SHOESIZE NAME CITY STATE and ZIP.
A more coherent example:
SORT CUSTOMER IF ORDER.LIMIT > "12,000.00" AND WITHOUT STATUS "INACTIVE" BY-DSND ORDER.LIMIT BY ZIP ORDER.LIMIT ZIP NAME STATUS
Which would select CUSTOMERs with $12K or more ORDER.LIMIT who are not INACTIVE and sort them form biggest limit to least... you get the idea.

Resources