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: SalesItemLineDetail not a valid related type?  (Read 1305 times)

pjreagan

  • Member
  • *
  • Posts: 48
SalesItemLineDetail not a valid related type?
« on: August 11, 2014, 05:28:33 PM »

Hmm...  I'm probably doing something wrong but QBO is not accepting "SalesItemLineData" as a valid type for a related record. 

The Developer's Guide, Demo File and ESR all seem to indicate that this code should work, but it doesn't..
PCQO_RqNew("create"; "Invoice") & ", " &
PCQO_RqAddFieldWithValue("TxnDate"; "2009-10-06") & ", " &
PCQO_RqAddFieldWithValue("PrivateNote"; "Exported from custom application") & ", " &
PCQO_RqAddRelatedRecord("Line") & ", " &
PCQO_RqAddFieldWithValue("Description"; "Late Fee: 11/5/2009 - 6/6/2014 at 10 percent") & ", " &
PCQO_RqAddFieldWithValue("Amount"; 1012.99) & ", " &
PCQO_RqAddFieldWithValue("DetailType"; "SalesItemLineDetail") & ", " &
PCQO_RqAddRelatedRecord("SalesItemLineData") & &
PCQO_SGetStatus


This is the error result that always comes up....
0, 0, 0, 0, 0, 0, 0, !!ERROR!!
An error occurred while adding a related record
CODE: -507
SEVERITY: Error
MESSAGE: Invalid type of related record
SOURCE: PCQO_RqAddRelatedRecord

What am I missing?
Logged

Jerel Malong

  • Global Moderator
  • Member
  • *****
  • Posts: 97
Re: SalesItemLineDetail not a valid related type?
« Reply #1 on: August 12, 2014, 07:50:30 AM »

It should be:

PCQO_RqAddRelatedRecord( "Line" )
<< HEADER DETAILS HERE >>
PCQO_RqAddRelatedRecord( "SalesItemLineDetail" )
<< LINE DETAILS HERE >>
PCQO_RqCloseRelatedRecord
PCQO_RqCloseRelatedRecord
Logged

pjreagan

  • Member
  • *
  • Posts: 48
Re: SalesItemLineDetail not a valid related type?
« Reply #2 on: August 12, 2014, 11:51:49 AM »

Sorry, I should have give more detail.  Yes, I understand that xml structure.  My design gathers each PCQO call in a global script variable as separate values (also known as a "virtual list").  After the script is done checking and creating all accounts/items/customers/etc. in QBOE, it loops through the virtual list to run each of the PCQO calls.  It was getting stuck at...
  PCQO_RqAddRelatedRecord("SalesItemLineData")
...because of a typo.  It should have been...
  PCQO_RqAddRelatedRecord("SalesItemLineDetail")

This became apparent when I manually created an invoice in QBO, queried it from FileMaker then compared the xml.
Sorry to bother you with a typo.  Details given for future readers.
Logged
Pages: [1]   Go Up