1

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>
Manas Mukherjee
  • 5,270
  • 3
  • 18
  • 30
Louis van Tonder
  • 3,664
  • 3
  • 31
  • 62

1 Answers1

2

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)
Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • ahhh. I failed to conenct .name, with "Fullname" .. will give it a spin, thanks! – Louis van Tonder May 28 '13 at 18:19
  • Even with your changes... I have the following error: When drilling down into it, it looks like... Could not load file or assembly 'Microsoft.CSharp' or one of its dependencies. The system cannot find the file specified. – Louis van Tonder May 28 '13 at 18:47
  • Actually... I did not have the : qbMsgReq.Attributes.OnError = ENRqOnError.roeContinue line specified in my code.. my hresult made more sense this time.... I had deleted the customer I was trying to add again.. for now, seems that cant be done. My code runs now, But I dont see my custom ID field populated... ideas? – Louis van Tonder May 28 '13 at 18:58
  • Update your code and/or post the XML response you get back from QuickBooks. – Keith Palmer Jr. May 28 '13 at 19:01
  • 1
    Ok, got it..! On the additional info scren in Quickbooks, its displayed in all caps. ID NUMBER, but when opening the define fields window, the Case was ID Number. Works a charm now. – Louis van Tonder May 28 '13 at 19:19
  • Thank you very much for your help Keith. Always appreciated. – Louis van Tonder May 28 '13 at 19:19