Question

I am running some tests to specify a value for a custom field that is already setup in quickbooks.

I cana dd the customer, but I fail to add the custom field... I think I have an issue @ "FullName" in the last DataExtMod line...

Any ideas on this? I get no specific error, just an 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)

UPDATE

My XML Responce:

        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

This part is obviously interesting... the custom field is just "ID NUMBER" , should I reference it in some other way? Naming convention?

<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>
Was it helpful?

Solution

The FullName you set in your DataExt should be the same as the FullName for the customer you're creating. Otherwise, you'll be telling QuickBooks to set the custom field for some other random object.

e.g. if this is the FullName of your customer:

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

Then you should use that same FullName in your DataExt:

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

' This is correct:
MyDataExtMod.ORListTxn.ListDataExt.ListObjRef.FullName.SetValue(str_name)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top