Author Topic: Added a new field to export, now I am getting odd errors.  (Read 1468 times)

Cambridge

  • Member
  • *
  • Posts: 1
I was adding in a field to export to the notes field in QB. Here is the plug in setup

 PCQB_RqAddFieldWithValue( "TxnDate"; Case(Length(Invoice::in_DateInvoiced)<6; Invoice::in_DateCreate;Invoice::in_DateInvoiced ) ) &
 PCQB_RqAddFieldWithValue( "RefNumber" ;Invoice::InvoiceNumber ) &
PCQB_RqAddFieldWithValue( "BillAddress::Addr1" ; Left(Invoice::ad_Bill1Name;41) ) &
PCQB_RqAddFieldWithValue( "BillAddress::Addr2" ; Left(Invoice::ad_Bill3School;40) ) &
PCQB_RqAddFieldWithValue( "BillAddress::Addr3" ; Left(Invoice::ad_Bill5Dept;41) ) &
PCQB_RqAddFieldWithValue( "BillAddress::Addr4" ; Left(Invoice::ad_Bill4Address1;41)) &
PCQB_RqAddFieldWithValue( "BillAddress::City" ; Invoice::ad_Bill6City ) &
PCQB_RqAddFieldWithValue( "BillAddress::State" ; Invoice::ad_Bill6State ) &
PCQB_RqAddFieldWithValue( "BillAddress::PostalCode" ; Case ( Length ( Invoice::ad_Bill6Zip4 )>0;Left(Invoice::ad_Bill6Zip;5) & "-" & Invoice::ad_Bill6Zip4; Invoice::ad_Bill6Zip ) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::Addr1" ; Left(Invoice::ad_Ship1Name;41) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::Addr2" ; Left(Invoice::ad_Ship2TitleDept;40) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::Addr3" ; Left(Invoice::ad_Ship3School;41) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::Addr4" ; Left(Invoice::ad_Ship4Address1;41) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::City" ; Invoice::ad_Ship6City ) &
PCQB_RqAddFieldWithValue( "ShipAddress::State" ; Invoice::ad_Ship6State ) &
PCQB_RqAddFieldWithValue( "ShipAddress::PostalCode" ; Case ( Length ( Invoice::ad_Ship6Zip4 )>0; Left(Invoice::ad_Ship6Zip;5) & "-" & Invoice::ad_Ship6Zip4; Invoice::ad_Ship6Zip ) ) &
PCQB_RqAddFieldWithValue( "ShipAddress::Note" ; "Date shipped" & Invoice::Date_shipped ) &
 PCQB_RqAddFieldWithValue( "ShipDate" ;Invoice::in_DateCreate)

Now whenever I try to run the script I get "Error 3205, there was an error when composing an address in, there is not enough address lines to compose the address"  I was told this maybe has something to do with a container field for the address but the script ran perfectly fine before I added in the PCQB_RqAddFieldWithValue( "ShipAddress::Note" ; "Date shipped" & Invoice::Date_shipped ) & line. Any ideas?

Jerel Malong

  • Global Moderator
  • Member
  • *****
  • Posts: 97
Re: Added a new field to export, now I am getting odd errors.
« Reply #1 on: June 19, 2014, 03:57:49 PM »
Are you doing all of this in one script step?

If needed we can do a remote session to review the issue. At your earliest convenience please give us a call directly at (760)510-1200 or you can email support@productivecomputing.com.

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Added a new field to export, now I am getting odd errors.
« Reply #2 on: June 20, 2014, 05:54:35 PM »
Any chance that one of the City/State/PostalCode source fields exceeds the character count limits?
Is it possible that one of the Ship Address source fields has a carriage return or other prohibited character?

HTH!

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

CoachChris

  • Member
  • *
  • Posts: 1
Re: Added a new field to export, now I am getting odd errors.
« Reply #3 on: July 08, 2014, 06:46:59 PM »
You cannot add more than 3 lines and at the same time use the city, state, and postal codes.  either omit the addr4 or add addr5 and omit city, state, and zip

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Added a new field to export, now I am getting odd errors.
« Reply #4 on: July 09, 2014, 07:28:24 AM »
I'm not finding anything in the 2013 QBSDK ProGuide that supports that conclusion, and I'm wondering how you came to it? It's certainly possible to enter 4 lines plus City, State, and PostalCode via QB's UI, and a Customer Query Request for that record will return Addr1 through Addr4 plus City, State, and PostalCode elements. And, according to the current QBSDK ProGuide you can issue a Modify that empties Addr1 through Addr4, plus City, State, and PostalCode. (page 127)

This suggests to me that your assertion may be correct but not what Intuit intended. It wouldn't be the first time there's a mismatch between documentation and behavior.

HTH!

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

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: Added a new field to export, now I am getting odd errors.
« Reply #5 on: July 09, 2014, 11:29:41 AM »
After a little digging, it looks like the Notes element can be problematic when there are 4 Addr lines plus City, State, and PostalCode. This is true even within the Edit Customer => Edit Shipping Address Information window in the QB UI--it allows entry of a Note value but clicking "OK" in the Edit Address Information dialog prepends the value of City with the value of Line4 when there's a Note Value AS LONG AS the concatenated values do not exceed the character count limit. (If it exceeds the character count, you'll get an error message.)

I suspect, but have not yet confirmed, that you can include the Addr4 element OR the Note element--BUT NOT BOTH-when passing City, State, and PostalCode elements. If I get a chance to look into this further, I'll post my findings here.

HTH!

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