Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Insert into InvoiceLine for Item of type PAYMENT - Missing Element TnxIdSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 Insert into InvoiceLine for Item of type PAYMENT - Missing Element TnxId 
 Author   Message 
  Jack Nichols 
  
 Group: Members 
 Posts: 14 
 Joined: 2006-06-01 
 Profile
 Posted : 2006-07-02 04:41:11

I am trying to insert a line item of type "Payment" into InvoiceLine.

All other types insert ok, payment is the only one that blows up.

Below is a query that blows up.

INSERT INTO InvoiceLine (CustomerRefFullName, TemplateRefFullName, BillAddressAddr1, BillAddressAddr2, BillAddressCity, BillAddressState, BillAddressCountry, ShipDate, InvoiceLineItemRefFullName, InvoiceLineDesc, InvoiceLineAmount, InvoiceLineSalesTaxCodeRefFullName, FQSaveToCache, CustomFieldreferral)
VALUES ('Abbas Hamzeh', 'DMK Medical PLLC', 'Abbas Aida', '5 Golfcrest Ct.', 'Dearborn', 'MI', '', {d'2006-06-29'}, 'Payment - Care Credit', 'Payment - Care Credit', 25.32, 'Non', 0, '21')

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-02 17:14:00
Sorry, you haven't said what error message you are getting. "Blowing up" is colourful, but I can't guess what the problem is other than saying the all items must link to a "Accounts Receivable" INCOME type account. You can't for example invoice an item that's linked to a "Accounts Payable" EXPENSE type of General Ledger account. 

  Top 
  Jack Nichols 
  
 Group: Members 
 Posts: 14 
 Joined: 2006-06-01 
 Profile
 Posted : 2006-07-03 22:15:01

The error message is:

[QODBC] Error: 3150 - There is a missing element: "TxnID".

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-04 08:31:00

Is 'Payment - Care Credit' an ItemInventory, ItemService, ItemNonInventory, or ItemOtherCharge?

What revision of QODBC are you using? Please show an example of what works?

Try also looking at the QODBC and SDK Messages for more hints?

See also: How do I turn on the trace log? 

 

  Top 
  Flash 
  
 Group: Members 
 Posts: 27 
 Joined: 2006-10-22 
 Profile
 Posted : 2008-10-01 00:48:45

I'm getting the same message. Very frustrating. Came to the board to find the resolution. No resolution yet.

Am inserting several invoice lines, then inserting the invoice.

Frustrating as it is, this is still the waaay coolest utility out there!!!

My sql:

INVOICELINE:

INSERT INTO INVOICELINE ("CustomFieldInvoiceLineOther1", "CustomFieldInvoiceLineOther2", "InvoiceLineItemRefListID", "InvoiceLineQuantity", "InvoiceLineRate", "FQSaveToCache") VALUES ('384903-234333','001','1400000-1036276947',2,0,1)

INVOICE:

INSERT INTO INVOICE ("CustomerRefListID", "CustomerRefFullName", "PONumber", "CustomFieldHomePhone") VALUES ('3CB0000-1067280283', 'New Enterprise REC:2003 Contract:Flitch to Brumbaugh Mountain', 'Flitch to Brumbaugh', 'Construction')

ERROR LOG:

2008-09-30 10:39:01 QODBC Ver:  8.00.00.240 *********************************************************************************************************************
IsAService: False
SQL Statement: INSERT INTO INVOICE ("CustomerRefListID", "CustomerRefFullName", "PONumber", "CustomFieldHomePhone") VALUES ('3CB0000-1067280283', 'New Enterprise REC:2003 Contract:Flitch to Brumbaugh Mountain', 'Flitch to Brumbaugh', 'Construction')
3150 - There is a missing element: "TxnID".
Input XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?qbxml version="6.0"?>
<QBXML>
    <QBXMLMsgsRq onError = "continueOnError" responseData = "includeAll">
        <InvoiceAddRq requestID = "1">
            <InvoiceAdd defMacro = "TxnID:F2FB7067-2B84-4250-A156-DDBC7D8F0EFD">
                <CustomerRef>
                    <FullName>New Enterprise REC:2003 Contract:Flitch to Brumbaugh Mountain</FullName>
                </CustomerRef>
                <PONumber>Flitch to Brumbaugh</PONumber>
                <InvoiceLineAdd>
                    <ItemRef>
                        <ListID>930001-1036272319</ListID>
                    </ItemRef>
                    <Quantity>3.00000</Quantity>
                    <Rate>0.00000</Rate>
                    <Other1>384903-234333</Other1>
                    <Other2>001</Other2>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <ListID>1400000-1036276947</ListID>
                    </ItemRef>
                    <Quantity>2.00000</Quantity>
                    <Rate>0.00000</Rate>
                    <Other1>384903-234333</Other1>
                    <Other2>001</Other2>
                </InvoiceLineAdd>
            </InvoiceAdd>
        </InvoiceAddRq>
        <DataExtAddRq>
            <DataExtAdd>
                <OwnerID>0</OwnerID>
                <DataExtName>Home Phone</DataExtName>
                <TxnDataExtType>Invoice</TxnDataExtType>
                <TxnID useMacro = "TxnID:"/>
                <DataExtValue>Construction</DataExtValue>
            </DataExtAdd>
        </DataExtAddRq>
    </QBXMLMsgsRq>
</QBXML>
Output XML:
<?xml version="1.0" ?>
<QBXML>
    <QBXMLMsgsRs>
        <InvoiceAddRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
            <InvoiceRet>
                <TxnID>130800-1222785541</TxnID>
                <TimeCreated>2008-09-30T10:39:01-05:00</TimeCreated>
                <TimeModified>2008-09-30T10:39:01-05:00</TimeModified>
                <EditSequence>1222785541</EditSequence>
                <TxnNumber>41550</TxnNumber>
                <CustomerRef>
                    <ListID>3CB0000-1067280283</ListID>
                    <FullName>New Enterprise REC:2003 Contract:Flitch to Brumbaugh Mountain</FullName>
                </CustomerRef>
                <ARAccountRef>
                    <ListID>E0000-883244035</ListID>
                    <FullName>Accounts Receivable</FullName>
                </ARAccountRef>
                <TemplateRef>
                    <ListID>310000-1091627494</ListID>
                    <FullName>Bedford Units Enter</FullName>
                </TemplateRef>
                <TxnDate>2008-09-30</TxnDate>
                <RefNumber>4769</RefNumber>
                <BillAddress>
                    <Addr1>New Enterprise Rural Electric</Addr1>
                    <Addr2>Rt. 869, PO Box 75</Addr2>
                    <City>New Enterprise</City>
                    <State>PA</State>
                    <PostalCode>16664</PostalCode>
                    <Note>Attn:  Les Zimmerman</Note>
                </BillAddress>
                <BillAddressBlock>
                    <Addr1>New Enterprise Rural Electric</Addr1>
                    <Addr2>Rt. 869, PO Box 75</Addr2>
                    <Addr3>New Enterprise, PA  16664</Addr3>
                    <Addr4>Attn:  Les Zimmerman</Addr4>
                </BillAddressBlock>
                <ShipAddress>
                    <Addr1>New Enterprise Rural Electric</Addr1>
                    <Addr2>Rt. 869, PO Box 75</Addr2>
                    <City>New Enterprise</City>
                    <State>PA</State>
                    <PostalCode>16664</PostalCode>
                    <Note>Attn:  Les Zimmerman</Note>
                </ShipAddress>
                <ShipAddressBlock>
                    <Addr1>New Enterprise Rural Electric</Addr1>
                    <Addr2>Rt. 869, PO Box 75</Addr2>
                    <Addr3>New Enterprise, PA  16664</Addr3>
                    <Addr4>Attn:  Les Zimmerman</Addr4>
                </ShipAddressBlock>
                <IsPending>false</IsPending>
                <IsFinanceCharge>false</IsFinanceCharge>
                <PONumber>Flitch to Brumbaugh</PONumber>
                <DueDate>2008-09-30</DueDate>
                <ShipDate>2008-09-30</ShipDate>
                <Subtotal>0.00</Subtotal>
                <SalesTaxPercentage>0.00</SalesTaxPercentage>
                <SalesTaxTotal>0.00</SalesTaxTotal>
                <AppliedAmount>0.00</AppliedAmount>
                <BalanceRemaining>0.00</BalanceRemaining>
                <IsPaid>true</IsPaid>
                <IsToBePrinted>false</IsToBePrinted>
                <IsToBeEmailed>false</IsToBeEmailed>
                <InvoiceLineRet>
                    <TxnLineID>130802-1222785541</TxnLineID>
                    <ItemRef>
                        <ListID>930001-1036272319</ListID>
                        <FullName>I K ASSEMBLIES</FullName>
                    </ItemRef>
                    <Quantity>3</Quantity>
                    <Rate>0.00</Rate>
                    <Amount>0.00</Amount>
                    <SalesTaxCodeRef>
                        <ListID>20000-1011986102</ListID>
                        <FullName>Non</FullName>
                    </SalesTaxCodeRef>
                    <Other1>384903-234333</Other1>
                    <Other2>001</Other2>
                </InvoiceLineRet>
                <InvoiceLineRet>
                    <TxnLineID>130803-1222785541</TxnLineID>
                    <ItemRef>
                        <ListID>1400000-1036276947</ListID>
                        <FullName>N M33-5</FullName>
                    </ItemRef>
                    <Quantity>2</Quantity>
                    <Rate>0.00</Rate>
                    <Amount>0.00</Amount>
                    <SalesTaxCodeRef>
                        <ListID>20000-1011986102</ListID>
                        <FullName>Non</FullName>
                    </SalesTaxCodeRef>
                    <Other1>384903-234333</Other1>
                    <Other2>001</Other2>
                </InvoiceLineRet>
            </InvoiceRet>
        </InvoiceAddRs>
        <DataExtAddRs statusCode="3150" statusSeverity="Error" statusMessage="There is a missing element: &quot;TxnID&quot;." />
    </QBXMLMsgsRs>
</QBXML>

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-01 14:03:49
I can't tell which country version of QuickBooks 2007 you are using, but I would guess if you remove CustomFieldHomePhone and its value the insert will work. 

  Top 
  Flash 
  
 Group: Members 
 Posts: 27 
 Joined: 2006-10-22 
 Profile
 Posted : 2008-10-02 00:12:12

You are right, Tom.

Removed customfieldhomephone and the sql works.

For others having the same problem, my workaround is:

  1. insert invoice (however you do it: invoice lines or whatever your method is)
  2. retrieve lastinsertid invoice
  3. update invoice with customfield information (I'm assuming the problem with other custom fields as well)
  4. insert next invoice

Little more coding but it works for me!!

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-10-02 08:51:53
Just so others can understand, there are two type of custom fields, those that are added to transaction lines (like InvoiceLine) and those that are added to the transaction header (like Invoice). Problems occur when you try to do both at once because of the way Data Extensions work in Intuit's qbXML SDK. Where mixed custom fields are used you need to limited the INSERTs to just transaction lines (like InvoiceLine) or update the transaction header (like Invoice) after the header insert. 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to