Productive Computing, Inc. Support Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Pages: [1]   Go Down

Author Topic: Create item: how set "I sell this product..."  (Read 1354 times)

pjreagan

  • Member
  • *
  • Posts: 48
Create item: how set "I sell this product..."
« on: July 19, 2014, 06:44:09 PM »

When creating a new item in QB, the code below runs with no error, but the resulting item is not associated with an income account.  The account is not showing on the account list, nor is it part of the xml returned when this account is queried.  The item cannot be used when manually creating an invoice.

The workaround is to manually edit the item in QBOE, then click the "I sell this product/service to my customers" check box.  Once this is done, the correct income account DOES appear as already be chosen in the Income Account field.  Saving this manually-adjusted item causes the accounts to show up in the item list and queries.  Also the item can be manually selected in a QB invoice.

What am I doing wrong with my plugin calls when creating an item?  The ESR for items doesn't seem to have a control for the "I sell this product..." check box.  Instead of referring to the income account by name, I've also tried by ID.  But this throws an error.

Any ideas?
Thanks in advance!


PCQO_BeginSession
PCQO_Authorize($$SessionTicket)
PCQO_RqNew("Create"; "Item")
PCQO_RqAddFieldWithValue("Name"; "test 140719_15 income")
PCQO_RqAddFieldWithValue("IncomeAccountRef::name"; "Services")
//PCQO_RqAddFieldWithValue("IncomeAccountRef::value"; "15")    // DIDN'T HELP
PCQO_RqAddFieldWithValue("ExpenseAccountRef::name"; "Cost of Goods Sold")
//PCQO_RqAddFieldWithValue("IncomeAccountRef::value"; "7")      // DIDN'T HELP
PCQO_RqExecute
Logged

Jerel Malong

  • Global Moderator
  • Member
  • *****
  • Posts: 97
Re: Create item: how set "I sell this product..."
« Reply #1 on: July 21, 2014, 07:57:36 AM »

Hi pjreagan.

I've had a similar scenario from my experience when using the FM Books Connector Online- It's like you said, the ESR was not much help in this case.

Through trial and Error I found out that in order to mark that checkbox you need to pass, in the following order:

IncomeAccountRef::Value
IncomeAccountRef::name

Hope this helps!
Logged

pjreagan

  • Member
  • *
  • Posts: 48
Re: Create item: how set "I sell this product..."
« Reply #2 on: July 21, 2014, 03:32:47 PM »

Excellent!  That worked.

It's really weird that the "V" of "IncomeAccountRef::Value" has to be capitalized.
This also holds true for "ExpenseAccountRef::Value".
In my tests it doesn't seem to matter which comes first the "::Value"  or the "::name".
In fact, the "::name" value doesn't even need to be in the code.  Just the "::Value" code is needed.
(Intuit should allow users to comment at the bottom of each ESR entry.)

Thanks Jerel!

Logged
Pages: [1]   Go Up