Plug-ins > FM Books Connector Online

create Non Inventory item?

(1/3) > >>

pjreagan:
Is it possible to create a Non Inventory item in QBOE?  No matter what I try, either using the plugin or manually on QBOE Plus, all I can create is a Service or Inventory item.

With the plugin, this works for Service items...
PCQO_RqNew("Create"; "Item") & ", " &
PCQO_RqAddFieldWithValue("Name"; "test Service") & ", " &
PCQO_RqAddFieldWithValue("IncomeAccountRef::Value"; "15") & ", " & 
PCQO_RqAddFieldWithValue("ExpenseAccountRef::Value"; "16") & ", " & 
PCQO_RqExecute

This works for Inventory items...
PCQO_RqNew("Create"; "Item") & ", " &
PCQO_RqAddFieldWithValue("Name"; "test Inventory") & ", " &
PCQO_RqAddFieldWithValue("UnitPrice"; "1") & ", " & 
PCQO_RqAddFieldWithValue("IncomeAccountRef::Value"; "15") & ", " & 
PCQO_RqAddFieldWithValue("PurchaseCost"; "1") & ", " & 
PCQO_RqAddFieldWithValue("ExpenseAccountRef::Value"; "16") & ", " & 
PCQO_RqAddFieldWithValue("AssetAccountRef::Value"; "17") & ", " & 
PCQO_RqAddFieldWithValue("TrackQtyOnHand"; "true") & ", " & 
PCQO_RqAddFieldWithValue("QtyOnHand"; "99") & ", " & 
PCQO_RqAddFieldWithValue("InvStartDate"; "2014-07-30T00:00:00") & ", " & 
PCQO_RqExecute

Explicitly calling the...
PCQO_RqAddFieldWithValue("Type"; "Non Inventory")
...throws an error.

If there's some way to create a Non Inventory Item using the QBOE interface, then I could query the item with the plugin to maybe figure out what calls to make.  This is how I got the Inventory items to create.  (The ESR is really lacking compared to the old OSR documentation.)

Has anyone gotten this to work?  What am I doing wrong?
Thanks!

Jerel Malong:
Yes I got this to work with specifying Type as "Non Inventory". Basically laid it out similar to the ESR in the exact order.

What error message are you getting if any with and without the type field?

pjreagan:
Hi Jerel!

Thanks for responding so quickly to my question.

I get an error on the third step of these...
PCQO_RqNew("Create"; "Item") & ", " &
PCQO_RqAddFieldWithValue("Name"; "test Non Inventory") & ", " &
PCQO_RqAddFieldWithValue("Type"; "Non Inventory")

The error details...
Error setting the field data
CODE: -999
SEVERITY: Exception
MESSAGE: Requested value 'Non Inventory' was not found.
SOURCE: mscorlib

What am I doing differently from your successful code?

Jerel Malong:
The order of which I passed my script was:

PCQO_RqNew( "Create" ; "Item" )
PCQO_AddFieldWithValue( "Name" ; <FIELD> )
PCQO_AddFieldWithValue( "Description" ; <FIELD> )
PCQO_AddFieldWithValue( "Active" ; "True" )
PCQO_AddFieldWithValue( "Taxable" ; <FIELD> )
PCQO_AddFieldWithValue( "UnitPrice" ; <FIELD> )
PCQO_AddFieldWithValue( "Type" ; "Non Inventory" )
PCQO_AddFieldWithValue( "IncomeAccountRef::Value" ; <FIELD> )
PCQO_AddFieldWithValue( "IncomeAccountRef::name" ; <FIELD> )

pjreagan:
Hmm...  'Still no love... 

Below is what's in my calculation field.  For efficiency's sake I run multiple PCQO calls one after another, the results separated by some kind of delimiter.  For testing purposes, I run these in FM's Data Viewer.  When FM uses the following code, and gets to setting the Type, the response comes back as an error.  (Maybe not too surprising since the ESR says that Type is Read-only?)  The item is actually created, but the Type is "Service".

My code...
PCQO_RqNew( "Create" ; "Item" ) & ", " &
PCQO_RqAddFieldWithValue( "Name" ; "test Service 140804_01" ) & ", " &
PCQO_RqAddFieldWithValue( "Description" ; "some description" ) & ", " &
PCQO_RqAddFieldWithValue( "Active" ; "True" ) & ", " &
PCQO_RqAddFieldWithValue( "Taxable" ; "True" ) & ", " &
PCQO_RqAddFieldWithValue( "UnitPrice" ; "1.25" ) & ", " &
PCQO_RqAddFieldWithValue( "Type" ; "Non Inventory" ) & &
PCQO_SGetStatus & &
PCQO_RqAddFieldWithValue( "IncomeAccountRef::Value" ; "15" ) & ", " &
PCQO_RqAddFieldWithValue( "IncomeAccountRef::name" ; "16" ) & ", " &
PCQO_RqExecute


The results...
0, 0, 0, 0, 0, 0, !!ERROR!!
Error setting the field data
CODE: -999
SEVERITY: Exception
MESSAGE: Requested value 'Non Inventory' was not found.
SOURCE: mscorlib
0, 0, 0

The response XML includes...
<Type>Service</Type>
So QB appears to use the default "Service" item type.

I'm still doing something wrong, huh?

Navigation

[0] Message Index

[#] Next page

Go to full version