Author Topic: Getting a chart of accounts  (Read 1697 times)

johnlewisdesign

  • Member
  • *
  • Posts: 81
Getting a chart of accounts
« on: May 22, 2013, 09:25:55 AM »
Hi guys

I need to return a compete Chart Of Accounts list showing all ledger codes and their description. What command would I use to get this information? Is there an example anywhere?

Thanks in advance,

John

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Getting a chart of accounts
« Reply #1 on: May 22, 2013, 11:31:07 AM »
An AccountQuery should do it. For future reference, here's a link to Intuit's OSR (On Screen Reference.)...

https://member.developer.intuit.com/qbSDK-current/Common/newOSR/index.html

HTH!

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

johnlewisdesign

  • Member
  • *
  • Posts: 81
Re: Getting a chart of accounts
« Reply #2 on: May 23, 2013, 01:42:41 AM »
Thanks, I am fully immersed in the OSR I just didn't know which type of command I should be looking for in the first place. I now have ListID, FullName and AccountType all coming in. All I need to do now is work out how to pull in the AccountNumber from IncludeRetElement and I'm in business.

For the record:

PCQB_RqNew("AccountQuery" ; ""  )
PCQB_RsGetFirstFieldValue( "ListID" )
PCQB_RsGetFirstFieldValue( "FullName" )
PCQB_RsGetFirstFieldValue( "AccountType" )

These are the lines that matter so far :)

Thanks as usual Geoffrey :)

johnlewisdesign

  • Member
  • *
  • Posts: 81
Re: Getting a chart of accounts
« Reply #3 on: May 23, 2013, 02:40:37 AM »
Yeah so I can get a name, which isn't the best, I really could do with getting the account number too.

Any ideas?


johnlewisdesign

  • Member
  • *
  • Posts: 81
Re: Getting a chart of accounts
« Reply #4 on: May 23, 2013, 04:35:10 AM »
OK, for the record, I was able to pull the value in finally using the AccountNumber. It WAS returning a zero, or nothing at all, so I went into QuickBooks->Edit->Preferences->Accounting and enabled these checkboxes:

Use Account Numbers
Show Lowest Subaccount only

Then I just used this in my loop as expected:

PCQB_RsGetFirstFieldValue( "AccountNumber" )