Author Topic: Update QuantityOnHand  (Read 2370 times)

andersmonsen

  • Member
  • *
  • Posts: 9
Update QuantityOnHand
« on: February 19, 2013, 10:46:00 AM »
Hello,
I'm able to update everything I need for an InventoryItem except QuantityOnHand.

I'm trying to find the right OSR message and sequence to update QuantityOnHand in QB from FileMaker. I've tried ItemInventoryMod, and get an error code -1000. Element 'QuantityOnHand' is unexpected according to content model of parent element 'ItemInventoryMod'. Expecting Reorderpoint.

There is a QuantityOnHand in the xml, but it appears to be inside the parent tag - ItemInventoryRet.

I'm not sure if I should be looking at InventoryAdjustmentAdd or InventoryAdjustmentMod, and if one of these, which xml element?

Thanks,
Anders

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Update QuantityOnHand
« Reply #1 on: February 19, 2013, 12:32:18 PM »
InventoryAdjustmentAdd is the Request you want. Looking at the InventoryAdjustmentLineAdd's QuantityAdjustment segment, you'll use the NewQuantity or QuantityDifference element.

That said, the InventoryAdjustment process in QB is fraught with pitfalls and gotchas because every adjustment will impact the Inventory Qty and Value of every downstream transaction that includes an adjusted Item.

HTH!

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

andersmonsen

  • Member
  • *
  • Posts: 9
Re: Update QuantityOnHand
« Reply #2 on: February 20, 2013, 12:59:52 PM »
Thanks. I am getting an error when I try this:
3140 ; Invalid reference to QuickBooks Account "<name of item>" in the InventoryAdjustment. The specified records does not exist in the list.

However, the item is in the QuickBooks Items list. Here is my sequence. I am not sure about the correct values for AccountRef::FullName and ItemRef::FullName. So, that lack of understanding of the proper values could be an issue, as could the fact that they Qty field in FMP is in the same table as the Item desc etc.

Set Variable [ $Result ; Value: PCQB_RqNew( "InventoryAdjustmentAdd" ; "" )]
Set Variable [ $Result ; Value: PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; ITEM::Name )]

Set Variable [ $Result ; Value: PCQB_RqAddRelatedRecord( "InventoryAdjustmentLineAdd" )]
Set Variable [ $Result ; Value: PCQB_RqAddFieldWithValue( "ItemRef::FullName" ; Item::Name )]
Set Variable [ $Result ; Value: PCQB_RqAddFieldWithValue( "QuantityAdjustment::NewQuantity" ; Item::Quantity )]
Set Variable [ $Result ; Value: PCQB_RqCloseRelatedRecord( "ItemRef::FullName" ; Item::Name )]

Set Variable [ $Result ; Value: PCQB_RqExecute]
check for errors script
-> error per above.







Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Update QuantityOnHand
« Reply #3 on: February 20, 2013, 03:31:35 PM »
The message is telling you that there's a problem with the AccountRef element. The value of FullName would usually be something different than the ItemRef's FullName value. Also, unless you have an Item named "<name of item>" in your QB Item List, that value is a problem. And even if it is in your QB Item List, you'll get an error unless you enclose Item::Name in the PCQB_SFormatString function like this...

PCQB_RqAddFieldWithValue( "ItemRef::FullName" ; PCQB_SFormatString( Item::Name ; "STRTYPE" ) )

HTH!

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

andersmonsen

  • Member
  • *
  • Posts: 9
Re: Update QuantityOnHand
« Reply #4 on: February 22, 2013, 08:31:53 AM »
Thanks. The <name of item> was just a term instead of "31576" (SKU) or "Pipe Fitting" or similar.

That's where my confusion lies. In other related records like Sales Order or Invoice updates, I can see that AccountRef::FullName refers to the customer name and then the ItemName is the related item name.

In this case, for the Item update, Qty is in the same table as Item Name, so I am not sure which value fits int he AccountRef vs. ItemRef. I'll include the item string and do some more research into the InventoryAdjustmentAdd message.

Thanks
--
Anders Monsen

andersmonsen

  • Member
  • *
  • Posts: 9
Re: Update QuantityOnHand
« Reply #5 on: February 22, 2013, 10:36:34 AM »
So, after reading some of Intuit's help files on changing this inside QB, it seems that AccountRef works when I use something like "Inventory Adjustment" or other account in QB, rather than anything in the Item.

I'm now successfully able to update QuantityOnHand. Just a matter of dealing with the pitfalls that you mention.

--
Anders Monsen