Author Topic: CheckAdd - No Error Messages & No Check in QB  (Read 2842 times)

DeanEBedford

  • Member
  • *
  • Posts: 5
CheckAdd - No Error Messages & No Check in QB
« on: October 26, 2012, 06:15:11 AM »
Dear Friends,

Hello from Prague!

I am attempting to create a CHECK with two line items using the CHECKADD function and I am unfortunately not receiving an Error Message as I step through the script steps nor am I receiving a Check added to the appropriate account in QuickBooks.

System Specs:
FileMaker Advanced 12v2
FMBooks Connector 4.0.0.3
QuickBooks Pro 2012
Windows Server (Data Center) Service Pack 2

Here is the script steps that I using:


# Dean Bedford October 22, 2012
# Dean Bedford October 25, 2012
#
Set Variable [ $$Result; Value:PCQB_EndSession ]
#
Set Variable [ $$Result; Value:PCQB_RqNew("CheckAdd" ) ]
#
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Raiffeinsen - Novi Sad") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; PSG Transaction::Date ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PayeeEntityRef::FullName" ; PSG Transaction::Name ) ]
#
Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAddList" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "NoviSad:Salary" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; PSG Transaction::Salary ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]
#
Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAddList" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Novi Sad:Insurance Social & Health" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; PSG Transaction::Taxes Health ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]
#
# Begin Session
Set Variable [ $$Result; Value:PCQB_BeginSession ( zxx_System_Variables::gQB File Name; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Result; Value:PCQB_EndSession ]

If anyone can assist with what may be the issue, it would be greatly appreciate and I will send you great Czech Candies to say 'thank you'.

All the best,
Dean

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #1 on: October 26, 2012, 06:29:45 AM »
Dean...

There may be other problems, but the one I spotted was a non-existent node name. Replace "ExpenseLineAddList" with "ExpenseLineAdd" and see if that fixes it.

HTH!

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

DeanEBedford

  • Member
  • *
  • Posts: 5
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #2 on: October 28, 2012, 09:57:43 AM »
Geoffrey,

First and foremost, 'thank you' for your response and your time and consideration!

I made the changes per your last post and unfortunately again I was unsuccessful in adding this 'CheckAdd' (code attached below).

If you by chance or anyone else reading this post, has very simply 'CheckAdd' coding, I can create a new Bank Account in QuickBooks to test the basic of 'Check Add' coding which has hard coded values over that from data fields.  That way we can start with baseline coding and establish the initial 'CheckAdd' connectivity.  Once I am able to establish baseline addition of a transaction, then I can work to add the bells and whistles of data from database fields.

All the best from Dublin where I am preparing to run in tomorrow's Dublin Marathon!

Sincerely,
Dean

# Dean Bedford October 22, 2012
# Dean Bedford October 25, 2012
# Dean Bedford October 28, 2012

Set Variable [ $$Result; Value:PCQB_EndSession ]

Set Variable [ $$Result; Value:PCQB_RqNew("CheckAdd" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Raiffeinsen - Novi Sad") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; "10/25/2012" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ;200) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PayeeEntityRef::FullName" ; "Bartos, Robert" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "NoviSad:Salary" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; 100 ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]

Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Novi Sad:Insurance Social & Health" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; 100 ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]

Set Variable [ $$Result; Value:PCQB_BeginSession ( zxx_System_Variables::gQB File Name; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Result; Value:PCQB_EndSession ]
« Last Edit: October 28, 2012, 10:02:54 AM by DeanEBedford »

DeanEBedford

  • Member
  • *
  • Posts: 5
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #3 on: October 28, 2012, 10:06:53 AM »
Please know I tried the coding above without quotes around the Amounts 200, 100 & 100 while also attempting it with the quotes below, and still no 'joy'.

# Dean Bedford October 22, 2012
# Dean Bedford October 25, 2012
# Dean Bedford October 28, 2012

Set Variable [ $$Result; Value:PCQB_EndSession ]

Set Variable [ $$Result; Value:PCQB_RqNew("CheckAdd" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Raiffeinsen - Novi Sad") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; "10/25/2012" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; "200") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PayeeEntityRef::FullName" ; "Bartos, Robert" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "NoviSad:Salary" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; "100" ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]

Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Novi Sad:Insurance Social & Health" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; "100" ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]

Set Variable [ $$Result; Value:PCQB_BeginSession ( zxx_System_Variables::gQB File Name; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Result; Value:PCQB_EndSession ]

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #4 on: October 28, 2012, 12:31:45 PM »
The hardcoded date is in the wrong format--it should be "2012-10-25". You should also format your Amount values with two decimal places--the PCQB_SFormatString function does that when you specify "AMTTYPE" as the qbType parameter. It will also format a date field's value by using "DATETYPE" as the qbType parameter.

HTH!

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

DeanEBedford

  • Member
  • *
  • Posts: 5
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #5 on: October 30, 2012, 03:27:03 AM »
Geoffrey,

Still not able to get the 'CheckAdd' coding to work, thus I am moving towards as simply a script as possible.  Please find the simply script, which unfortunately does not work below.  Any ideas of what may be the issue!

Again, 'thank you' for your time and consideration!

Sincerely,
Dean

# Dean Bedford October 30, 2012

Set Variable [ $$Result; Value:PCQB_EndSession ]

Set Variable [ $$Result; Value:PCQB_RqNew("CheckAdd" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "QB") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; "2012-10-25" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ;"200.00") ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PayeeEntityRef::FullName" ; "PairNic" ) ]

Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Uncategorized Expenses" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; "200.00" ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]

# Begin Session
Set Variable [ $$Result; Value:PCQB_BeginSession( zxx_System_Variables::gQB File Name; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Result; Value:PCQB_EndSession ]

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #6 on: October 30, 2012, 06:43:31 AM »
Insert a Set Variable step with the argument PCQB_SGetStatus between PCQB_RqExecute and PCQB_EndSession steps.

Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Status; Value:PCQB_RqExecute ]
Set Variable [ $$Result; Value:PCQB_EndSession ]

The value of $$Status should offer some insight into the nature of the problem.

HTH!


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

jSanders

  • Member
  • *
  • Posts: 20
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #7 on: November 07, 2012, 02:37:03 PM »
I don't know if it is the same on your system but I recently found that stepping through a script with the Script Debugger and Data Viewer caused a FAILURE TO CAPTURE ERRORS.

 When I let the script run straight through and used Custom Dialog to display error I was successful in capturing errors.

go figure.

-J

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #8 on: November 07, 2012, 02:55:18 PM »
Make sure the Data Viewer's Watch tab has no active arguments calling the FMBooks Connector plug-in. I suspect the failure to capture errors is because there's an active (and successful) call. And make sure that the $$VarName differs from your default $$Result. I just realized that the Set Variable step I showed in my previous response had the wrong argument. It should have read...

Set Variable [ $$Status; Value:PCQB_SGetStatus ]

HTH!


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

DeanEBedford

  • Member
  • *
  • Posts: 5
Re: CheckAdd - No Error Messages & No Check in QB
« Reply #9 on: November 08, 2012, 01:38:35 AM »
Geoffrey,

Again, first and foremost, 'thank you' for your response and your time and consideration!

Yes, that did the trick since I was able to read the error that was causing the issue.  In the end, it was the order of the Set Field entries that caused the problem.  Once I placed the fields in the correct order based on the Onscreen Reference for Intuit Software Development Kits (http://developer.intuit.com/qbsdk-current/Common/newOSR/index.html) I was cooking with gas!

Please find below the working script which hopefully can assist others if they come across the same problem in the future.


# Dean Bedford October 22, 2012
# Dean Bedford October 25, 2012
# Dean Bedford November 07, 2012
#
Set Variable [ $$Result; Value:PCQB_EndSession ]
#
Set Variable [ $$Result; Value:PCQB_RqNew("CheckAdd" ) ]
#
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Raiffeinsen Bank" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PayeeEntityRef::ListID" ; Transaction | QB Employee::ListID ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "RefNumber" ; Transaction::NUM ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; Transaction::Date ) ]
// Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Memo" ; "Woohoo" ) ]
#
Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Salary" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; Transaction::Amount ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]
#
Set Variable [ $$Result; Value:PCQB_RqAddRelatedRecord( "ExpenseLineAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AccountRef::FullName" ; "Social & Health" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Amount" ; Transaction::Amount ) ]
Set Variable [ $$Result; Value:PCQB_RqCloseRelatedRecord ]
#
# Begin Session
Set Variable [ $$Result; Value:PCQB_BeginSession( zxx_System_Variables::gQB File Name; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqExecute ]
Set Variable [ $$Status; Value:PCQB_SGetStatus ]
Set Variable [ $$Result; Value:PCQB_EndSession ]
#
Set Field [ PSG Transaction::xx_Status; $$Status ]