Author Topic: Chart of Account Number  (Read 3489 times)

Yachtlink

  • Member
  • *
  • Posts: 16
Chart of Account Number
« on: February 06, 2015, 03:29:14 PM »
How do I get the chart of account number? I tried every commend listed up AccountQuery, I get names and values but not the number as in Income account 4110

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Chart of Account Number
« Reply #1 on: February 06, 2015, 04:25:27 PM »
As far as I know, the account number is identified in the AccountNumber element. Using...

PCQB_RsGetFirstFieldValue( "AccountNumber" )

...should give you the value you're looking for.

HTH!

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

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #2 on: February 07, 2015, 06:48:05 AM »
Yes I figured that out, I had to fifure this out to be able to understand what goes into creating an Inventory Item, as I see the item requires that Income ans Asset Accounts are included, but I've tried all of the possible options that the ocr shows for CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at IncomeAccountRef
Reason:   Element 'IncomeAccountRef' is unexpected according to content model of parent element 'ItemInventoryAdd'.
Expecting: ReorderPoint, Max, QuantityOnHand, TotalValue, InventoryDate, ExternalGUID.

Field Value:   

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Chart of Account Number
« Reply #3 on: February 07, 2015, 03:47:44 PM »
A couple quick notes:

Specifying the Income Account and Asset Account is NOT required--QB will use its default values when they are not specified.

The "Expecting:..." line of the message is really useful, because it tells you where in the sequence of elements you've gone off the rails.

Because the ReorderPoint element should follow the AssetAccountRef and the "MESSAGE:" identifies IncomeAccountRef as unexpected, it's likely that PrefVendorRef is being followed by IncomeAccountRef. It SHOULD be followed by AssetAccountRef. IncomeAccountRef must come before the PurchaseDesc and/or PurchaseCost element(s).

The sequence of elements is critical, and the API will throw an error whenever an element appears after another element that should follow it. It's okay to skip optional elements, but not to repeat an element that is not marked "may repeat". ( See XMLOps tab of the OSR. )

HTH!

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

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #4 on: February 10, 2015, 11:43:01 AM »
Thank you, can I assume the correct order would be of that listed on the OSR from top to bottom?

Dan

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #5 on: February 10, 2015, 11:57:35 AM »
I only have the request to ItemInventoryAdd and one other giving a value into Name, but I still get this message about an income account
CODE: 3180
SEVERITY: Error
MESSAGE: There was an error when saving a Item Inventory list, element "Number 3 Inventory Part".  QuickBooks error message: An income account must be specified.

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Chart of Account Number
« Reply #6 on: February 10, 2015, 12:50:57 PM »
Yes, the sequence of the OSR is the model for the order in which each element in the Request must appear.

HTH!

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

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Chart of Account Number
« Reply #7 on: February 10, 2015, 01:23:00 PM »
What version of QB are you using?

I double checked the OSR, and IncomeAccountRef is marked optional. I'm fairly sure that my assertion was accurate in an earlier version of QB, but it may have been the case that the QB Company file had only a single Income-type account.

I found additional descriptions at...

https://developer.intuit.com/docs/api/accounting

...and...

https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/item

...that say sales items must have an IncomeAccountRef, purchase items must have an ExpenseAccountRef and inventory items must have an AssetAccountRef. I've never seen these pages before, but they appear to be newer than the OSR pages, and much more complete.

Whatever the case may have been, and regardless of what the OSR currently says, the error message you received and the above referenced documentations leads me to conclude that the AccountRef elements are not optional.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
« Last Edit: February 10, 2015, 01:31:59 PM by Geoffrey Gerhard »

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #8 on: February 10, 2015, 03:25:53 PM »
it is 2014, I am also getting errors telling me I need PurchaseTaxCodeRef and IsTaxIncluded, which are Canada and UK, so maybe I have something set wrong

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #9 on: February 10, 2015, 04:14:43 PM »
Well I got all the way through all fields anf now I get this
CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at ExternalGUID
Reason:   '343434343' violates pattern constraint of '0|(\{[0-9a-fA-F]{8}(\-([0-9a-fA-F]{4})){3}\-[0-9a-fA-F]{12}\})'.
The element 'ExternalGUID' with value '343434343' failed to parse.

Field Value:   343434343

I'm not sure what this value should be, when I pull it from QuickBooks it's empty,
I wish there were a referrence guide for this plugin

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #10 on: February 11, 2015, 08:44:40 AM »
getting closer, I added every filed in the right oreder, I think, now I get this message
CODE: 3250
SEVERITY: Error
MESSAGE: This feature is not enabled or not available in this version of QuickBooks.


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Chart of Account Number
« Reply #11 on: February 11, 2015, 09:18:27 AM »
The ExternalGUID failure is caused by incorrect formatting of the value. It needs to look like this...

XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

...where X is a hexadecimal digit.

That said, I've never encountered a need for a an ExternalGUID. If you don't have a specific need for one, omit that element. If you do need it, I'm curious to hear about it--as far as I know, it would only be needed when integrating with data from another (non-FileMaker) external application.

As for the latest error: make sure you've selected the correct checkbox under QB Editions. It sounds like you're using a UK / Canadian version of QB, and I suspect you've selected US as the QB Edition.

HTH!

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

Yachtlink

  • Member
  • *
  • Posts: 16
Re: Chart of Account Number
« Reply #12 on: February 11, 2015, 09:49:27 AM »
Not sure where to select the QB Edition, but I disabled everything and started from the begining anfd got it working, so I suspect that you were right about the sequence, which now I only have the name and accounts, but it did need income, Asset and COGS accounts specified