我正在运行一些测试来指定已经在快速手册中设置的自定义字段的值。
我可以添加客户,但我无法添加自定义字段...我想我在最后一个 DataExtMod 行中有一个问题@“FullName”...
对此有什么想法吗?我没有得到任何具体的错误,只是一个 hresult。
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 "ID NUMBER" 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 "ID NUMBER" specified in the request cannot be found. QuickBooks error message: This feature is not enabled or not available in this version of QuickBooks." /> </QBXMLMsgsRs>