【问题标题】:Quickbooks API / XML custom fieldsQuickbooks API / XML 自定义字段
【发布时间】:2014-09-15 16:48:39
【问题描述】:

这是我在这里的第一篇文章。我正在使用适用于 Windows 的 Quickbooks 来传递数据以创建发票,该发票除了您在 Quickbooks 中创建的自定义字段外,其他所有功能都有效。我无法在我的 XML 中发送自定义字段的值。我得到这个错误。我希望指出正确的方向。

<?xml version="1.0"?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceAddRs requestID="143" statusCode="3180" statusSeverity="Error"     statusMessage="There was an error when saving a data extension named &quot;Shipper Name&quot;.  QuickBooks error message: The specified custom field cannot be used by the list or transaction element."/>
</QBXMLMsgsRs>
</QBXML>

这是 XML:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <InvoiceAddRq>
            <InvoiceAdd>
                <CustomerRef>
                    <ListID>80000006-1410484985</ListID>
                </CustomerRef>
                <RefNumber>1642</RefNumber>
                <BillAddress>
                    <Addr1>Scott's Trucking</Addr1>
                    <Addr2>1004 Just sample data</Addr2>
                    <City>Isanti</City>
                    <State>MN</State>
                    <PostalCode>90210</PostalCode>
                    <Country>USA</Country>
                </BillAddress>
                <ShipAddress>
                    <Addr1>Mike's Trucking</Addr1>
                    <Addr2>123 dr</Addr2>
                    <City>Hayward</City>
                    <State>WI</State>
                    <PostalCode>54843</PostalCode>
                    <Country>USA</Country>
                </ShipAddress>
                <Memo>From Exspeedite Shipment #1642</Memo>
                <InvoiceLineAdd>
                    <DataExt>
                        <OwnerID>0</OwnerID>
                        <DataExtName>Shipper Name</DataExtName>
                        <DataExtValue>Bob</DataExtValue>
                    </DataExt>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <Desc>COMMODITIES</Desc>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <Desc>-----------</Desc>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <Desc>Freight of All Kinds (FAK) 3 pallets 3 items 1000 LBs </Desc>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Handling</FullName>
                    </ItemRef>
                    <Desc>Handling charges</Desc>
                    <Quantity>1</Quantity>
                    <Amount>60.00</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Freight</FullName>
                    </ItemRef>
                    <Desc>Freight charges</Desc>
                    <Quantity>1</Quantity>
                    <Amount>4600.00</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Mileage</FullName>
                    </ItemRef>
                    <Desc>Mileage</Desc>
                    <Quantity>2000</Quantity>
                    <Rate>2.30</Rate>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Fuel_Surcharge</FullName>
                    </ItemRef>
                    <Desc>Fuel surcharge</Desc>
                    <Quantity>1</Quantity>
                    <Amount>1120.00</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C104 -  - Reconsignment</Desc>
                    <Quantity>1</Quantity>
                    <Amount>60.09</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C104 -  - Reconsignment</Desc>
                    <Quantity>1</Quantity>
                    <Amount>60.09</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C118 - Inia Swan - Reconsignment</Desc>
                    <Quantity>1</Quantity>
                    <Amount>250.00</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C122 - XSTOP2 - Reconsignment</Desc>
                    <Quantity>1</Quantity>
                    <Amount>30.00</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C106 -  - Layover</Desc>
                    <Quantity>1</Quantity>
                    <Amount>91.02</Amount>
                </InvoiceLineAdd>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>Other</FullName>
                    </ItemRef>
                    <Desc>C107 -  - Layover</Desc>
                    <Quantity>1</Quantity>
                    <Amount>11.76</Amount>
                </InvoiceLineAdd>
        </InvoiceAdd>
        </InvoiceAddRq>
    </QBXMLMsgsRq>
</QBXML>

【问题讨论】:

    标签: xml quickbooks


    【解决方案1】:

    根据你的说法:

    我正在寻找整个发票级别的自定义字段,而不是订单项级别的自定义字段

    然而,您正在在订单项级别传递它们

                **<InvoiceLineAdd>**
                    <DataExt>
                        <OwnerID>0</OwnerID>
                        <DataExtName>Shipper Name</DataExtName>
                        <DataExtValue>Bob</DataExtValue>
                    </DataExt>
                **</InvoiceLineAdd>**
    

    (添加星号是为了强调——请注意,您已将自定义字段放在一个行项目中

    如果您正在寻找自定义字段在行项目之外,在发票本身内,那么您应该将 DataExt 请求在行项目之外 --例如做这样的事情:

    <?xml version="1.0" encoding="utf-8"?>
    <?qbxml version="11.0"?>
    <QBXML>
    <QBXMLMsgsRq onError="continueOnError"><InvoiceAddRq>
      <InvoiceAdd defMacro="TxnID:Invoice19993557">
         ...
      </InvoiceAdd>
    </InvoiceAddRq>
    <DataExtAddRq requestID="86290">
      <DataExtAdd>
        <OwnerID>0</OwnerID>
        <DataExtName>Del. Phone #</DataExtName>
        <TxnDataExtType>Invoice</TxnDataExtType>
        <TxnID useMacro="TxnID:Invoice19993557"/>
        <DataExtValue>773-527-2199</DataExtValue>
      </DataExtAdd>
    </DataExtAddRq>
    </QBXMLMsgsRq>
    </QBXML>
    

    来源:

    【讨论】:

    • 我正在寻找整个发票级别的自定义字段,而不是行项目级别的自定义字段,但我在架构中看不到它。这通过了验证器但失败了。
    • keith,@scott,如果你们中有人处理过发票,你们知道这个自定义数据/字段在快速手册中的位置吗?我会很感激你的回应
    • 它位于 QuickBooks 发票上的自定义字段中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-29
    • 2016-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多