Author Topic: InvoiceAdd, "RefNumber" is unexpected  (Read 2223 times)

nimlok

  • Member
  • *
  • Posts: 3
InvoiceAdd, "RefNumber" is unexpected
« on: May 31, 2012, 09:55:04 AM »
I have trouble to add an invoice to QuickBook Enterprise 12.

Code: -1000
SEVERITY: failed validation
MESSAGE: Element "RefNumber" is unexpected according to content model of parent element "InvoiceAdd".
.......

Script:

PCQB_RqAddFieldWithValue( "RefNumber"  ; "123456")

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: InvoiceAdd, "RefNumber" is unexpected
« Reply #1 on: May 31, 2012, 12:20:12 PM »
What are the PCQB_RqAddFieldWithValue() calls immediately ahead of and following the RefNumber? The order matters and you'll get that message when you try to put it ahead of an element that should precede it or behind an element that should follow it.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
« Last Edit: June 05, 2012, 02:32:14 PM by Geoffrey Gerhard »

nimlok

  • Member
  • *
  • Posts: 3
Re: InvoiceAdd, "RefNumber" is unexpected
« Reply #2 on: June 05, 2012, 12:53:40 PM »
I did not change the order. I made couple changes on the example script from Developer Guide.
Here is the example script:
A sample InvoiceAdd request demonstrates the usage of these two functions.
PCQB_RqNew( "InvoiceAdd" )
PCQB_RqAddFieldWithValue( "CustomerRef::FullName" ; "Bob Jones" )
PCQB_RqAddFieldWithValue( "TxnDate" ; "2006/01/01" )
PCQB_RqAddFieldWithValue( "RefNumber" ; "123456789" )
PCQB_RqAddFieldWithValue( "BillAddress::Addr1" ; "123 Any Street" )
PCQB_RqAddFieldWithValue( "BillAddress::City" ; "Any Town" )
PCQB_RqAddFieldWithValue( "BillAddress::State" ; "Any State" )
PCQB_RqAddFieldWithValue( "BillAddress::PostalCode " ; "11111" )
....

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: InvoiceAdd, "RefNumber" is unexpected
« Reply #3 on: June 05, 2012, 02:31:43 PM »
Is there a second PCQB_RqAddFieldWithValue( "RefNumber" ... call in your script?

HTH!

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

nimlok

  • Member
  • *
  • Posts: 3
Re: InvoiceAdd, "RefNumber" is unexpected
« Reply #4 on: June 07, 2012, 01:25:10 PM »
No,
Any help?

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: InvoiceAdd, "RefNumber" is unexpected
« Reply #5 on: June 08, 2012, 05:30:53 PM »
The error message is coming from QB, not the plugin. The only time I've seen that message is when an element is being passed in the wrong sequence--either ahead of a preceding element or behind a trailing element. A second occurrence is the only thing I can think of that would generate that message if the first call is in the right place. You didn't post a complete list of the plug-in calls that occur in your script. If you want to take a screen shot and post it, I'll let you know if I see anything that's out of place.

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