QBFC:添加新客户时指定自定义字段数据(自定义字段已存在)

时间:2013-05-28 14:19:59

标签: intuit-partner-platform intuit qbfc

我正在运行一些测试,以指定已在quickbooks中设置的自定义字段的值。

我能告诉客户,但我没有添加自定义字段...我想我在最后一个DataExtMod行中有一个问题@“FullName”...

有关于此的任何想法吗?我没有特别的错误,只是一个结果。

 Dim custAdd As ICustomerAdd = qbMsgReq.AppendCustomerAddRq

        Dim str_name As String = "Louis Pluto Test 2 - ZA Code"
        Dim str_phone As String = "0764128111"

        custAdd.Name.SetValue(str_name)
        custAdd.Phone.SetValue(str_phone)
        custAdd.Email.SetValue("email@addy.com")
        custAdd.FirstName.SetValue("myname")
        custAdd.LastName.SetValue("my lastname")
        custAdd.fullname.setvalue()


        'add custom ID field...
        Dim MyDataExtMod As IDataExtMod
        MyDataExtMod = qbMsgReq.AppendDataExtModRq

        MyDataExtMod.OwnerID.SetValue("0")
        MyDataExtMod.DataExtName.SetValue("ID NUMBER")
        MyDataExtMod.DataExtValue.SetValue("0123456789012")
        MyDataExtMod.ORListTxn.ListDataExt.ListDataExtType.SetValue(ENListDataExtType.ldetCustomer)
        MyDataExtMod.ORListTxn.ListDataExt.ListObjRef.FullName.SetValue(str_name)

更新

我的XML响应:

        MyDataExt_resp.ToXMLString  "<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs> <CustomerAddRs requestID="0" statusCode="0" statusSeverity="Info" statusMessage="Status OK"> <CustomerRet> <ListID>8000051D-1369767881</ListID> <TimeCreated>2013-05-28T21:04:41+02:00</TimeCreated> <TimeModified>2013-05-28T21:04:41+02:00</TimeModified> <EditSequence>1369767881</EditSequence> <Name>Louis Test User with ID2</Name> <FullName>Louis Test User with ID2</FullName> <IsActive>true</IsActive> <Sublevel>0</Sublevel> <FirstName>Louis</FirstName> <LastName>van Tonder</LastName> <Phone>0123456789</Phone> <Email>email@addy.com</Email> <AdditionalContactRef> <ContactName>Main Phone</ContactName> <ContactValue>0123456789</ContactValue> </AdditionalContactRef> <AdditionalContactRef> <ContactName>Main Email</ContactName> <ContactValue>email@addy.com</ContactValue> </AdditionalContactRef> <Balance>0.00</Balance> <TotalBalance>0.00</TotalBalance> <JobStatus>None</JobStatus> </CustomerRet> </CustomerAddRs> <DataExtModRs requestID="1" statusCode="3120" statusSeverity="Error" statusMessage="Object &quot;ID NUMBER&quot; specified in the request cannot be found.  QuickBooks error message: This feature is not enabled or not available in this version of QuickBooks." /> </QBXMLMsgsRs> </QBXML> " String

这部分显然很有趣......自定义字段只是“ID NUMBER”,我应该以其他方式引用它吗?命名惯例?

<DataExtModRs requestID="1" statusCode="3120" statusSeverity="Error" statusMessage="Object &quot;ID NUMBER&quot; specified in the request cannot be found.  QuickBooks error message: This feature is not enabled or not available in this version of QuickBooks." /> </QBXMLMsgsRs>

1 个答案:

答案 0 :(得分:2)

您在DataExt中设置的FullName应与您正在创建的客户的FullName相同。否则,您将告诉QuickBooks为其他随机对象设置自定义字段。

e.g。如果这是您客户的FullName:

Dim str_name As String = "Louis Pluto Test 2 - ZA Code"

然后你应该在你的DataExt中使用相同的FullName:

' This is *wrong*:
MyDataExtMod.ORListTxn.ListDataExt.ListObjRef.FullName.SetValue("Myname mylastname")

' This is correct:
MyDataExtMod.ORListTxn.ListDataExt.ListObjRef.FullName.SetValue(str_name)