Author Topic: ItemSalesTaxGroupQuery retrieving Tax Items  (Read 1928 times)

MartinL

  • Member
  • *
  • Posts: 4
ItemSalesTaxGroupQuery retrieving Tax Items
« on: August 04, 2011, 10:14:53 AM »
Hi

I am using QuickBooks Premier 2011 and am trying to query the Tax Groups in QB from within FileMaker.
I have a tax group with 2 tax items associated with it and although I can successfully execute the ItemSalesTaxGroupQuery and display the Group Name I cannot work out how to list the Tax Items associated with the group. When I use 'ItemSalesTaxRef:FullName' it will return the name/code of the first tax item but the IDN OSR does not indicate how to get the other tax item.

Does anyone know how to do this. ???

Many Thanks

Martin

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: ItemSalesTaxGroupQuery retrieving Tax Items
« Reply #1 on: August 04, 2011, 11:41:29 AM »
I would get it via XPATH, but that's because I use the "PCQB_Z" functions for almost everything. Assuming you've just queried QB for the specific Item Sales Tax Group, that method would look like this...

PCQB_ZParseXML( PCQB_SGetXML( "Response" ; "" ) ; "" ; "/ItemSalesTaxGroupQueryRs/ItemSalesTaxGroupRet/ItemSalesTaxRef[2]/FullName/text()" ; "" )

Using the native "PCQB_Rs" functions would use this series of calls...

PCQB_RsOpenFirstRelatedRecord( "ItemSalesTaxRef" )
PCQB_RsOpenNextRelatedRecord
PCQB_RsGetFirstFieldValue( "FullName" )

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


Chris

  • God
  • Member
  • *****
  • Posts: 83
Re: ItemSalesTaxGroupQuery retrieving Tax Items
« Reply #2 on: August 11, 2011, 09:42:39 AM »
the order needs to change...


PCQB_RsOpenFirstRelatedRecord( "ItemSalesTaxRef" )
PCQB_RsGetFirstFieldValue( "FullName" )
PCQB_RsOpenNextRelatedRecord


:)

chris

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: ItemSalesTaxGroupQuery retrieving Tax Items
« Reply #3 on: August 11, 2011, 11:08:44 AM »
I don't think so, since he was asking about retrieving the second tax item. I should have suggested he use the "RelatedRecords" functions to retrieve all elements that the OSR identifies as "optional, may repeat."

PCQB_RsOpenFirstRelatedRecord( "ItemSalesTaxRef" )
PCQB_RsGetFirstFieldValue( "FullName" ) // first Group Sales Tax Item
PCQB_RsOpenNextRelatedRecord
PCQB_RsGetFirstFieldValue( "FullName" ) // second Group Sales Tax Item

I wonder how developers use the OSR...are they advised look at the XMLOps tab in the OSR in the plug-in documentation? It has a lot of useful detail that isn't well presented in the Request and Response tabs.

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