Plug-ins > FM Books Connector Online

Significance of errors?


Hi Everybody!
Miss me?  It's been so long...   ;D

I need to be able to provide feedback to my users as to whether an invoice push to QBO has been successful.  The main problem is that QBO will sometimes return an error even when it successfully creates an invoice. 

For example,  the following error mostly make sense.  It occurred when an attempt was made to push an invoice with a transaction date before the inventory start date for an inventory item.   It makes sense that QBO did not create an invoice.  From my experience with the previous SDK using qbxml, this is expected behavior and provides useful information that can be presented to a user to help them fix the problem.
An error occurred during execution
    CODE: 0
    SEVERITY: Exception
    MESSAGE: Transaction date is prior to start date for inventory item
    Transactions with inventory (QOH) products cant be dated earlier than the Inventory Start Date for the product
Note the code erroneously indicates success, even though the invoice was not created.  However this is not a huge deal since the message still provides useful information for my users.

But the following error was thrown even though QBO did create an invoice. 
    An error occurred during execution
    CODE: -990
    SEVERITY: Exception
    MESSAGE: '', hexadecimal value 0x19, is an invalid character. Line 1, position 1850.
    SOURCE: System.Xml
This is a significant logic problem and the feedback is totally useless.  The referenced character is wrong.  (In fact the problem was an apostrophe in a line description.)  The position has no meaning in the request xml.  The error code is not listed in QB ESR documentation and the invoice still was created!  And for all this trouble, the API simply stripped out the apostrophe.  I don't remember that the previous SDK behaving like this.

1) Is there a list of QB allowed characters someplace?  All I'm able to find is a list of allowable operators.
2) How does one escape apostrophes?  The normal backslash escape character doesn't seem to help.
3) From QB provided errors, how is one supposed to figure out if an invoice has been created?  There doesn't seem to be an answer to this in the PC sample file, the Developer's Guide, the Functions Guide or the ESR.  Is it safe to ignore all -990 errors?  Are there other errors that are safe to ignore?

What am I missing?

Jerel Malong:
1. Here are two links from Intuit that may help:

2 & 3. I have passed this along to our products team for their review. Once we have an update on these, we will post the results on here.

We apologize for the inconvenience.

Chris Turner:
Hi pjreagan,

In investigating the issues in regards to the plug-in reporting an error with a code value of "0" and real error data (such as the first example you posted), and the plug-in reporting an error with a code value of "-990" and error data, but also having a successful request execution, we've found quite a bit of information out, as I will discuss below.

When Intuit encounters a validation error (i.e. missing a required field), QuickBooks will return an error exception, containing information about the problem and on occasion best practices to resolve it. In reviewing the return of an error of this type, we found that the actual error code (which is supposed to be set and provided by Intuit) does not always get set, even though the message is valid. Your example of the transaction date being prior to the start date of the inventory item is a prime example of one of these cases. As such, we've considered this case when updating the plug-in for the next release to ensure that no matter what, when we encounter an error, we get some kind of code value other than 0, since we want 0 to always be successful.

When it comes to the -990 code, that code is a general exception error code that we reserve for all errors that are encountered that we did not expect, or were caused not by Intuit's validation, but by the plug-in or a process or library the plug-in relies upon. -990 errors might be due to invalid characters, missing system resources, invalid references, and the like. We've done testing specifically with invoices to replicate the -990 error you are seeing, and found that when pushing an invoice where any of its data (invoice, invoice line, customer, etc.) contains an XML-based reserved character, such as an ampersand (&), a less-than sign (<), or a smart quote (curly " or curly '), the plug-in will load that information and submit it to Intuit, but in the process of Intuit's data service (which uses the "System.Xml" library), it will generate an exception, as you saw with the hexadecimal value. This error is happening after the request is processed, which explains why it was created in QuickBooks Online, and while the system is interpreting the result. The plug-in catches the error, and since it is not a validation error or defined Intuit error, it falls back to a -990 general exception error result, and is reported as you have seen. And indeed, when looking at the created invoice on QuickBooks Online, the bad apostrophe that was sent was stripped out.

We have added this into our issues and enhancements to improve how error handling is performed by the plug-in, as well as to see what can be done to handle smart quote values passed in as data with PCQO_RqAddFieldWithValue. What we can recommend is to ensure that any data passed to the plug-in to be sent to QuickBooks does not have any of those special characters. & and < are automatically replaced with "&amp;" and "&lt;" respectively (which are valid XML character codes), and smart quotes can be disabled by editing the File Options of your FileMaker solution (File > File Options... > Text tab, uncheck "Allow use of smart quotes"), and re-entering the quotation marks in your fields, or filtering them out of the data going into the FM Books Connector Online plug-in.

In summary, part of the issue is the data being passed to Intuit is not valid or contains invalid characters, such as the apostrophe. It's not a very apparent issue, and I have personally experienced this before in the original FM Books Connector plug-in; qbXML doesn't like smart quotes, either, I've found. Another part of the issue is how Intuit's data service interprets incoming and outgoing data. Though the incoming data is accepted (albeit with the bad characters above scraped away), the data coming back to the plug-in hits a snag when trying to parse it from the raw data (in XML or JSON format) into a more compatible object that the plug-in can work with. The final part is how the plug-in itself handles such snags, and how meaningful the responses are made when submitted back to the end user.

It is unfortunate that this kind of situation exists, as it is understandably frustrating to the developer to account for such a bizarre reaction. Please rest assured that we will do whatever we can to prepare the plug-in for situations like this, but also understand that we cannot account for everything, and that certain things can happen that we did not expect. The best thing to do in that kind of case would be to inform us of the behavior and provide as detailed information as you can; what data did you send, what were your solution settings, what were the errors reported by the plug-in, etc. That way, we can verify the problem, determine the root cause of it, and resolve it, either with a workaround or possibly a bug fix.



[0] Message Index

Go to full version