Author Topic: Push invoice FAIL  (Read 2321 times)

jSanders

  • Member
  • *
  • Posts: 20
Push invoice FAIL
« on: October 22, 2012, 04:02:10 PM »
I efforts to push a simple invoice from my FMP DB to QB have failed thus far.


I CAN push an invoice from the DEMO DB.
My script is based on the Push Script in the demo DB.
I have a strong belief that I am successfully connecting to QB.
I get an !!ERROR!! When I reach the step in which I call the request execute function:

     Set Variable [$$CALL; Value:PCQB_RqExecute]

 I have not been able to successfully capture this error.

My guess is that my request is malformed.

Please have mercy upon my soul and examine my (cough) "code" then fling mud upon the errors there in so I can identify them!

-Joe



jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #1 on: October 22, 2012, 04:17:53 PM »
I have tweaked this script with no change in results:

changed ARAccountREF to "Accounts Receivable"  vs "truck pay"  (wrong account)
changed ItemRef::FullName to "Trucking Services" vs "trucking income  (not an "Item")

revised image below:

-J


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Push invoice FAIL
« Reply #2 on: October 23, 2012, 06:49:25 AM »
You have a typo on "ARAccountREF"--it should be "ARAccountRef". If that doesn't fix it, what shows in your first Show Custom Dialog?

HTH!

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

jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #3 on: October 23, 2012, 08:48:56 AM »
Corrected that spelling error.  Same behavior.

My call of  PCQB__RqExecute  using the Variable "$$CALL"  Shows !!ERROR!! in the data viewer but still can't seem to capture that error. 

See custom dialog and data viewer below.



Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Push invoice FAIL
« Reply #4 on: October 23, 2012, 01:09:16 PM »
Looked a little closer at your code. Maybe replace the slashes in your TxnDate value with dashes. There's a function ( PCQB_SFormatString ) that makes formatting easier. A few other ideas: Maybe the Rate you're passing needs to be formatted as PRICETYPE (which would be "150.00" instead of 150 ), Maybe Rate requires a Qty value, Maybe replace Rate with Amount. Maybe none of these are relevant--I apply formatting and don't pass a Rate without a Qty so I can't say for sure if they're any part of the problem.

If none of these solve it, add another step to your script right after the "Execute the request" comment.  Set Variable [ $$myXML ; PCQB_SGetXML ( "Request" ) ] and post the value of $$myXML here.

HTH!

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

jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #5 on: October 23, 2012, 01:56:47 PM »
Thank you for the ideas.   Will advise!

jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #6 on: November 03, 2012, 06:55:37 AM »


I tried all the fixes suggested.  No change.
I found some RqAddFieldWithValue commands out of proper sequence.  No change.

I accidently ran the script with the script debugger OFF and trapped the following error:

CODE: -1000
SEVERTY: failed validation
MESSAGE: Error at ARAccountRef
Reason: Text is not allowed in the context of element

This is very interesting!!!

When I run the script with the script debugger on.  The entire script will run with out displaying any error dialogs I have built in.  However, if I turn the script debugger off, Filemaker captures the error!!  WEIRD

So I'm off to fix my ARAccountRef.  I think I can puzzle that out.

-J

jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #7 on: November 03, 2012, 07:14:44 AM »
Well now I'm capturing errors like a mad man.

I disabled my ARAccountRef command just to see what the rest of the script would do.  I get a new error:

CODE: -1000
SEVERITY:  failed validation
MESSAGE: Error at TxnDate
Reason: Union doesn't support this value.

My TxnDate looks like this:

Set Variable [$$CALL; Value:PCQB_RqAddFieldWithValue( "TxnDate" ; "2012/11/1")]

same result if I express the date like this:  "2012-11-1"

Any insight is appriciated.

-Joe




jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #8 on: November 03, 2012, 07:29:00 AM »
Using "11-1-2012"

Eliminates this error... so I had month/day/year in the wrong order.

Moving along the next error:

MESSAGE: Error at RefNumber
Reason: Element 'RefNumber' is unexpected according

I'm thinking my RefNumber command is out of order.

Any suggestions?

jSanders

  • Member
  • *
  • Posts: 20
Re: Push invoice FAIL
« Reply #9 on: November 05, 2012, 07:01:50 AM »

RefNumber  command was out of order.

My script works!!!! WHOO HOO!!!

-j