Author Topic: Can't seem to get custom field in Invoice to update....  (Read 1222 times)

trebor

  • Member
  • *
  • Posts: 57
Can't seem to get custom field in Invoice to update....
« on: December 18, 2014, 12:52:26 PM »
I looked at the other posts and tried to recreate it but I keep getting an error.

Here is the part of my script I execute the custom field add, this is after I pull the TxnID and some other stuff: end session then begin a new on to send over the custom field.  But I keep getting 3120 Error, "ORDERER" cannot be found.  The field is there I see it on the invoice.

-----  begin script -------------

Web Data : Push Invoice to QB
Set Field [ Company::qResult; PCQB_EndSession ]
#Capture QB Invoice number and other info
Set Field [ Company::qResult; PCQB_RsOpenFirstRecord ]
Set Field [ Orders::QB_TxnID; PCQB_RsGetFirstFieldValue( "TxnID" ) ]
Set Field [ Orders::QB_Invoice_Date; PCQB_RsGetFirstFieldValue( "TxnDate" ) ]
Set Field [ Orders::QB_Invoice_Number; PCQB_RsGetFirstFieldValue( "RefNumber" ) ]
Set Field [ Orders::QB_Invoice_amount; PCQB_RsGetFirstFieldValue( "SubTotal" ) ]
Set Field [ Orders::QB_Invoice_amount2; PCQB_RsGetFirstFieldValue( "BalanceRemaining" ) ]
#Set the Custom Field ORDERER
Go to Layout [ “Orders” (Orders) ]
Set Variable [ $orderer; Value:Orders::Sub_Fname & " " & Orders::Sub_Lname ]
Set Variable [$TxnID; Value::Orders::QB_TxnID]
Go to Layout ["Company" (Company)]
Set Field [ Company::qResult; "" ]
Set Field [ Company::qResult; PCQB_RqNew( "DataExtMod"; ) ]
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "OwnerID";"0") //Owner ID is always zero ]
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "DataExtName";"Orderer") ]
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "TxnDataExtType";"Invoice") ]
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "TxnID";Orders::QB_TxnID) ]
//Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "DataExtValue";$orderer) ] <-- I have this commented out same as line below different way of doing it gave same error.
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "DataExtValue";Orders::Sub_Fname & " " & Orders::Sub_Lname) ]
Set Field [ Company::qResult; PCQB_BeginSession( ""; "" ) ]
Set Field [ Company::gStatus; PCQB_SGetStatus ]
Set Field [ Company::qResult; PCQB_RqExecute ]
Set Field [ Company::gStatus; PCQB_SGetStatus ]
Set Field [ Company::gStatus; PCQB_SGetXML( "Response" ; "" ) ]
//Set Variable [ $$Result; Value: PCQB_SGetXML( "Response" ; "" ) ]
Set Field [ Company::qResult; PCQB_EndSession ]

-----------------  end script -------------------

The error I get is :
CODE: 3120
SEVERITY: Error
MESSAGE: Object "ORDERER" specified in the request cannot be found. Quickbooks error message: Attribute with specified name cannot be found.

I am doing something obviously wrong, but what?  The Custom field "Orderer" is in Qb and on the invoice.  I have tried both all uppercase and proper case.  Neither works. Or is their a hidden custom name I am missing?

Thanks
Rob


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 469
Re: Can't seem to get custom field in Invoice to update....
« Reply #1 on: December 18, 2014, 01:30:39 PM »
The error message suggests you that there's no Custom Field named Orderer. I believe case is irrelevant in this context. You might try doing a DataExtDefQuery Request with an OwnerID value of 0. The result is a list of all UI-accessible Custom Field Names and the objects to which they're assigned. Use PCQB_SGetXML( "Result" ; "" ) to see them all.

See whether "Orderer" is on the list, and what AssignToObject values are contained in its node. I don't recall if it's possible to assign a Custom Field to the Customer List that's inaccessible from a SalesOrder, nor what error that might trigger.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852

trebor

  • Member
  • *
  • Posts: 57
Re: Can't seem to get custom field in Invoice to update....
« Reply #2 on: December 18, 2014, 02:15:28 PM »
I have not done a DataExtDefQuery, any help on how to do this is greatly appreciated.  I tried a couple ways and am not getting it.

I tried :

Set Field [ Company::qResult; PCQB_RqNew("DataExtDefQuery";)]
Set Field [ Company::qResult; PCQB_RqAddFieldWithValue( "OwnerID";"0") ]
Set Field [ Company::qResult; PCQB_BeginSession( ""; "" ) ]
Set Field [ Company::gStatus; PCQB_SGetStatus ]
Set Field [ Company::qResult; PCQB_RqExecute ]
Set Field [ Company::gStatus; PCQB_SGetStatus ]
Set Field [ Company::qResult; PCQB_SGetXML( "Result" ; "" ) ]

Gave this result:  A query request did not find a matching object in QuickBooks.

I know there are two custom fields; SS IF EIN, and ORDERER. When i go to the tab with custom fields, i see them, and when I click into custom fields I see them.  Both appear on the Invoice.


Thanks
Rob

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 469
Re: Can't seem to get custom field in Invoice to update....
« Reply #3 on: December 18, 2014, 06:35:41 PM »
How were those custom fields added? The OwnerID is 0 when a Custom Field is added via the native UI, but could be almost anything when they're added via the External API. The odd thing is that only those Custom Fields with an OwnerID of 0 should be visible in the UI.

Odd....

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852