Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2445 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I'm trying to write a script to pull all received payments for a specific customer using the EntityFilter::FullNameWithChildren since the demo file indicates this will pull only the transactions for the specified customer but what I'm getting is all payments received (or at least the first 50 since I left that escape in the loop).  I'm using the customer's FullName (as it is used in Quickbooks) set into a variable for the Field Value parameter of the PCQB_ReAddFieldWithValue script step (v 16). So I have 2 questions: Why is the Entity Filter not working? and if what I really would rather do is pull all received payments within a given date range, how do I format the PCQB_ReAddFieldWithValue script step to do that?

Thanks,

Christi

Posted

Hi Christi,

It's possible that the evaluation of the request might be experiencing an error (such as a validation error or something of that nature), which would cause the response XML to still maintain the previous successful response, which would be the "all received payments" result. In that case, checking the result of PCQB_SGetStatus immediately after PCQB_RqExecute should show what is missing.

I was able to successfully test pulling all received payments for a specific Customer and their Jobs using the following script (I used the "Sample Products-Based Business" company file available in QuickBooks 2016):

PCQB_RqNew [Select; Results:$result; Request Type:"ReceivePaymentQuery"]
PCQB_RqAddFieldWithValue [Select; Results:$result; QB Field Name:"EntityFilter::FullNameWithChildren"; Field Value:"Jacobsen, Doug"] // Doug Jacobsen has 4 received payments associated with his Jobs
PCQB_RqExecute [Select; Results:$result] // Value of $result is 0
PCQB_SGetXML [Select; Results:$responseXML; XML Document Type:"Response"] // Contained the resulting XML set describing 4 received payments

 

If you wanted to use the date range instead of a customer reference (for example, all received payments in January, 2021, since the sample file is in the future), you could structure your script like so:

PCQB_RqNew [Select; Results:$result; Request Type:"ReceivePaymentQuery"]
PCQB_RqAddFieldWithValue [Select; Results:$result; QB Field Name:"TxnDateRangeFilter::FromTxnDate"; Field Value:"01/01/2021"] // Start from January 1st, 2021
PCQB_RqAddFieldWithValue [Select; Results:$result; QB Field Name:"TxnDateRangeFilter::ToTxnDate"; Field Value:"01/31/2021"] // End on January 31st, 2021
PCQB_RqExecute [Select; Results:$result] // Value of $result is 0
PCQB_SGetXML [Select; Results:$responseXML; XML Document Type:"Response"] // Contained the resulting XML set describing 6 received payments within the month of January 2021

 

Hope this helps!

- Chris

Posted

Hey, Christi.

It seems likely that there's a typo in your variable name or the variable is null because of an empty field or calc that produces no result. An empty node is acceptable to both the plug-in and the QB API, and if that's the only filter, would create a QueryResponse of all records.

HTH!

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

Hey, Chris.

I'm curious about the format of your function calls. The first line in FMP 16 32-bit looks like this...

PCQB_RqNew( "ReceivePaymentQuery" )

...without any Select or Results:$result parameters.

Geoff

  • Newbies
Posted

Geoffrey, I don't think it's a typo because I copied it straight out of the demo files, but it's possible.  Anyway, since what I really want to do is the date range filter, I'll use PCIPal's response in helping me understand how those filters are written.  It's helpful to have more than one example of these calls since the documentation isn't always super clear on what goes where.  Having multiple examples really helps see the patterns in how it's all supposed to work, so thanks to both of you.

peace,

Christi

This topic is 2445 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.