Adding Other Tables
If you are using our simple starter, and you want to sync data with other QuickBooks Online tables, besides the built-in Invoices Customers, and Items, this document will show you how to do it. Mostly it's some copying and pasting followed by a little bit of editing. Once you are done the new table will sync along with everything else
If you are using our Simple Starter ( Fmqbo2.fmp12 file ) as your solution you'll be doing all the editing in that file. If you have your own file and you are connecting to fmQBO, you'll need to make any changes to the data tables in your file. All the other changes will be in our Simple Starter. If you are using your own solution make sure you read the documentation on how that works.
We'll use Vendors in this example. Since Vendors is a lot like Customers we'll use Customers as our template.
1. Create a New Vendor Table
If you are using your own system and it already has a vendor table, you'll want to use that. Otherwise, make a new Table. If it's a new table, add all the vendor fields you want to track. Take a look at the QuickBooks Online Vendor object, to see what fields you might want to add. We'll call this Table "Vendors", you may have another name for it.
2. Add the qbo Fields
Each table that is connected to QuickBooks Online gets a couple of fields. "qbo_id" and "qbo_send". See the Customers table in the Simple Starter for how those are defined, and if you have FileMaker Pro Advanced you can copy them right out of Customers and Past them into your Vendors table. Optionally add the qbo_error field too from Customers too.
3. Add IdVendor field to QBOSync
You'll need to add a field to the QBOSync table in our Simple Starter. Name it "IdVendor" It should be just like the IdCusomer one that is already there.
4. Create Relationship
Create a relationship between QBOSync and a Table Occurrence based on your Vendors table. Call the TO QBOSync_Vendor . Use the new IdVendor field you just created and link it to the Primary Key of your Vendor table. Make sure to allow creation of related record to be checked on the QBOSync_Vendor side
5. Add A Record to QBOEntity
We need a record for your new table in the QBOEntity table . Go to the "QBOEntity", create a new record. Set the "name" field to "Vendor". This needs to exactly match the name of the QBO Entity your are linking to. Set the Resource Group field to "List" and set the sort Order to 1. Set "sendAllowed" to one if you are going to allow sending, as well pulling data to/from QBO.
6. Duplicate "Customer" Config folder
Since we are using Vendors in the example we'll copy Customers since it is the most similar. If you are doing "Sales Receipts" you might want to choose "Invoices". Look in the QBOSync Config -> Lists folder. You'll See a "Customers" folder. Duplicate it. Change the names of the folder and the included scripts to use "Vendors" instead of "Customers".
7. Edit Config Scripts
There are three scripts in that folder. The first one should now be named "Vendor Key Fields". Open that script, and follow the instructions to remap the Set Variable steps there to hook to Vendor fields instead of Customer fields.
The other two scripts will require more extensive editing. This is where take the data from QBO and map it to specifc fields in the database. The "Get" version is getting data from QBO, parsing it and setting into fields. The Send version does the opposite. You'll need to look at the Intuits docs to see how the mapping breaks down for vendors. This is by far the most difficult and tedious step. This is also where you'll spend some time tweaking as you decide what fields you care about.
We have a free tool which can help you generate the field mapping code. It's called Generator. (We'll have some more docs on how to use that soon )
8. Edit Script "Call Key Fields ( entity )"
Open this script and look in the section with IF statements about LISTs. You'll see a branch for each of the entities. Add one their for Vendor, by duplicating the code for one of the other ones. Change it to work with Vendor and have the Perform script call the "Vendor Key Fields Script". Also, edit the variable so it get's its value from GetFieldName( QBOSync::IdVendor)
9. Edit "Call Map: Get ( json )"
Here we are telling the sync engine which "Map" script to use when we are Getting Vendors. Add a branch to the IF statements for Vendor. Use the branch for Customer as a model. Set the Perform Script to call your new "Vendor Map: Get script"
10. Edit "Call Map: Send (
Here we are telling the sync engine which "Map" script to use when we are SENDING Vendors. Add a branch to the IF statements for Vendor. Use the branch for Customer as a model. Set the Perform Script to call your new "Vendor Map: Send script".
11. Setup Sync Settings
Go back to the Simple Starter Dashboard and click the Sync Status button. You should now see a record in the portal for "Vendor". Check the Boxes for Send and Get.
That should do it. Try the sync. :-)