无法在带有额外字段的 QuickBook 桌面中添加客户

Unable to Add Customer in QuickBook Desktop with Extra Fields

当我尝试发送额外的字段时,网络连接器日志中出现错误

<?xml version="1.0"?>
<?qbxml version="2.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <CustomerAddRq requestID="1">
            <CustomerAdd>
                <Name>Mohammed Ibrahim</Name>
                <CompanyName>IBM</CompanyName>
                <FirstName>Mohammed</FirstName>
                <LastName>Ibrahim</LastName>
                <MiddleName>as</MiddleName>
                <BillAddress>
                    <Addr1>hyderabad</Addr1>
                    <City>Hyderabad</City>
                    <State>Telangana</State>
                    <PostalCode>56564</PostalCode>
                    <Country>India</Country>
                </BillAddress>
                <Phone>78998797879</Phone>
                <Fax>+45545555</Fax>
                <Email>ibbu@mtitdc.net</Email>
            </CustomerAdd>
        </CustomerAddRq>
    </QBXMLMsgsRq>
</QBXML>

如果您搜索错误信息:

0x80040400 QuickBooks found an error when parsing the provided XML text stream.

您会发现 构建 qbXML 请求时顺序很重要

例如,如果 qbXML 请求在 OSR 中定义如下:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <CustomerAddRq>
      <CustomerAdd>
        <Name>STRTYPE</Name>
        <FirstName>STRTYPE</FirstName>
        <MiddleName>STRTYPE</MiddleName>
        <LastName>STRTYPE</LastName>
        ...

那么下面的就不行了(因为<Name>…</Name><FirstName>…</FirstName>标签的顺序相反):

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <CustomerAddRq>
      <CustomerAdd>
        <FirstName>Keith</FirstName>        
        <Name>Keith R Palmer</Name>
        <MiddleName>R</MiddleName>
        <LastName>Palmer</LastName>
        ...

请参阅 QuickBooks OSR 参考:

并确保您以正确的顺序发送 qbXML 标签。