Author Topic: confused by inventory tables  (Read 1998 times)

nealalanfrank

  • Member
  • *
  • Posts: 8
confused by inventory tables
« on: March 19, 2013, 07:07:50 AM »
Greetings,

I'm simply needing to pull down records from QB's inventory structure in order to show updated QoH within FileMaker for reporting. I've looked through the OSR and done some experimentation but I'm just getting error after error. I'm not querying for certain inventory items I just want all the records. The OSR shows quite a few Message Types with the word "inventory" and "query" in them, but none of them are giving me what I need. Suggestions?

Thanks!!

Neal

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: confused by inventory tables
« Reply #1 on: March 19, 2013, 08:54:47 AM »
Are you sending an ItemQuery Request? It's handy in some scenarios, but the Response may contain multiple ItemTypes and that can be a challenge.

You may find it easier to make a separate Query Request for each relevant Item type. QuantityOnHand is relevant only for ItemInventory and ItemInventoryAssembly records. Note that the latter is only available in QB Premiere and Enterprise editions.

HTH!

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

nealalanfrank

  • Member
  • *
  • Posts: 8
Re: confused by inventory tables
« Reply #2 on: March 19, 2013, 09:29:25 AM »
Hi Geoffrey,

Thanks for the quick reply. As I worked my way through the OSR Message Types that had the word "inventory" and "query" I was struggling with which to use. I admit that I'm finding the OSR difficult to understand. I will take another look for ItemQuery.

Thanks!

Neal

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: confused by inventory tables
« Reply #3 on: March 19, 2013, 03:21:50 PM »
Please don't take another look for ItemQuery--that's the opposite of what I intended to suggest. You'll have a much easier time if you use separate Query Requests for each ItemType.

HTH!

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

nealalanfrank

  • Member
  • *
  • Posts: 8
Re: confused by inventory tables
« Reply #4 on: March 22, 2013, 01:37:05 PM »
Alright. I was able to get the inventory records by using the InventoryItemQuery message type. However, as I loop through the response I'm getting exactly every other record. My query responded with 18 records. My loop created 9 records. I know this because I found out about the function in the plugin for getting the xml of the response. very cool. So, I see the missing records and they are the even number records. Bizarre. Any suggestions?

Thanks!
Neal

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: confused by inventory tables
« Reply #5 on: March 23, 2013, 07:47:08 AM »
Check your script to see where you're calling the "PCQB_RsOpenNextRecord" function. I suspect you'll find it's happening more than once.

You mention looking at the xml. If you're using xPath, check to see where you're incrementing your iterator's value and see if it's happing more than once.

HTH!

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

nealalanfrank

  • Member
  • *
  • Posts: 8
Re: confused by inventory tables
« Reply #6 on: March 23, 2013, 11:00:52 AM »
That was it!!

Thank you Geoffrey.