Author Topic: GeneralDetailReportQuery trying to pull Customer Total Sales for a date range  (Read 1712 times)

  • Member
  • *
  • Posts: 13
Can anyone help with this...error returns 0 but $Total is blank???

Report Displays just fine in QB.

Set Variable [ $__dateFrom; Value:GetParam("__dateFrom") ]
Set Variable [ $__dateTo; Value:GetParam("__dateTo") ]
Set Variable [ $result; Value:PCQB_RqNew ( "GeneralDetailReportQuery" ; "" ) ]
Set Variable [ $result; Value:PCQB_RqAddFieldWithValue ( "GeneralDetailReportType" ; "SalesByCustomerDetail" ) ]
Set Variable [ $result; Value:PCQB_RqAddFieldWithValue ( "DisplayReport" ; "1" ) ]
Set Variable [ $result; Value:PCQB_RqAddFieldWithValue ( "ReportPeriod::FromReportDate" ; $__dateFrom ) ]
Set Variable [ $result; Value:PCQB_RqAddFieldWithValue ( "ReportPeriod::ToReportDate" ; $__dateTo ) ]
Set Variable [ $result; Value:PCQB_RqAddFieldWithValue ( "ReportEntityFilter::ListID" ;ACCTING_::_Result_g_ListID CUST ) ]
If [ PCQB_RqExecute ≠ 0 ]
      Show Custom Dialog [ Title: "Error"; Message: "Quickbooks¶¶" & PCQB_SGetStatus; Buttons: “OK”, “Cancel” ]
   Set Variable [ $result; Value:PCQB_RsOpenFirstRecord ]
   Set Variable [ $Total; Value:PCQB_RsGetFirstFieldValue ( "ReportData::TotalRow" ) ]
End If

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
The data you requested is coming back in the Response, but a Report's Response format is WAY different from other Response formats.

The plug-in has two functions [ PCQB_RsGetAttribute( AttributeName ) ; PCQB_RsGetResponseAttribute( AttributeName ) ] that have been listed as "**Still under development**" in the Functions_GFuide_FM_Books_Connector.pdf file for years. Don't know if their development is complete in the latest build, but it might be worth asking Productive Computing directly about their status.

If they're still not functional, you'll need to figure out the XPATH to your target values. XPATH parsing is extremely efficient and powerful, but those benefits sit at the top of a steep learning curve. I've provided consultation and programming help to developers trying to figure out how to parse reports over the years, but it's generally beyond the scope of what can be efficiently accomplished in a support forum.


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

  • Member
  • *
  • Posts: 13
I called Productive and they told me the 2 functions we are awaiting [ PCQB_RsGetAttribute( AttributeName ) ; PCQB_RsGetResponseAttribute( AttributeName ) ] would not be ready in the next version but they would notifiy me at that time whenever it was.


  • God
  • Member
  • *****
  • Posts: 83
Hi All,

Nice speaking with you Mike.

When it comes to working with the report xml the plug-in is simply untested.  I am confident that the 'attribute' parsing functions work, we just haven't validatatd that with internal testing.

Geoffrey has a vast amount of experience with the FM Books Connector (i wouldnt be suprised if he is billing 60 hours a week implementing the plug-in) and I agree with him that when it comes to the report processing XPATH is the way to go.  It will be much quicker than iterating over the response data row by row.

I would have enjoyed taking on the project, but I feel that your money will be better spent with Geoffrey as he has more experience with XPATH than I do...he will be able to create the XPATH Queries in a fraction of the time that I will.  I recommend getting in touch with Geoffrey to go over the report that you want to parse and perhaps enter into an agreement where he can share his knowlege on the use of XPATH queries.