Search code examples
c#quickbooksqbfc

Is there a limit on the amount of Quickbooks report query requests at one time?


Is there a limit to the amount of report queries that can be added/returned from a MsgSetRequest at one time in QBFC?

I'm currently creating and adding multiple GeneralSummaryReportQuery's to the MsgSetRequest (say 30), but after I do the requests things seem to go wrong. I can see the ResponseList being the correct size, but after the first 10 Response's in the list, the status code for the remaining responses changes to 3320 which indicates that the report cannot be generated. If I run the same report with the same filters with less queries added to the request, the report is successfully generated.

I've looked through the QBSDK ProGuide book as well as done some googling, but I haven't seen anything online that mention this limitation.

Here's some sample code for what it's worth:

IMsgSetRequest msgSetReq = sessionManager.CreateMsgSetRequest("US", 13, 0);
msgSetReq.Attributes.OnError = ENRqOnError.roeContinue;
foreach (string key in traversalOrder) {
    IGeneralSummaryReportQuery summaryReportQuery = msgSetReq.AppendGeneralSummaryReportQueryRq();
    summaryReportQuery.GeneralSummaryReportType.SetValue(ENGeneralSummaryReportType.gsrtProfitAndLossByJob);
    summaryReportQuery.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add(tableData[key].FullName);
}

//Now do all the queries
IMsgSetResponse msgSetResp = sessionManager.DoRequests(msgSetReq);

for (int k = 0; k < msgSetResp.ResponseList.Count; k++) {
    IResponse resp = msgSetResp.ResponseList.GetAt(k);

    if (resp.StatusCode >= 0 && resp.Detail != null) {
        //do stuff -- this only enters in the first 10 Responses in the ResponseList
    }
}

I enabled verbose logging and looked into the logs - the report requests are being generated as expected in XML format:

<GeneralSummaryReportQueryRq requestID = "9">
<GeneralSummaryReportType>ProfitAndLossByJob</GeneralSummaryReportType>
<ReportEntityFilter>
<FullName>TestGuy9</FullName>
</ReportEntityFilter>
</GeneralSummaryReportQueryRq>

<GeneralSummaryReportQueryRq requestID = "10">
<GeneralSummaryReportType>ProfitAndLossByJob</GeneralSummaryReportType>
<ReportEntityFilter>
<FullName>TestGuy10</FullName>
</ReportEntityFilter>
</GeneralSummaryReportQueryRq>

However, further down in the logs we see the report generation fail, but no indication as to why. This continues for any remaining report requests that follow.

20190919.103424 I   16112   QBSDKMsgSetHandler  QUERY: General Summary Report
20190919.103424 D   16112   ReportStorage::DoQuery  Processing request for report: ProfitAndLossByJob
20190919.103424 D   16112   ReportStorage::DoQuery  Setting report type
20190919.103424 D   16112   ReportStorage::DoQuery  Initializing report defaults
20190919.103424 D   16112   ReportStorage::DoQuery  1st override of defaults
20190919.103424 D   16112   ReportStorage::DoQuery  Initializing report
20190919.103424 D   16112   ReportStorage::DoQuery  2nd override of defaults
20190919.103424 D   16112   ReportStorage::DoQuery  Generating the report
20190919.103425 D   16112   ReportStorage::DoQuery  Building the response
20190919.103425 D   16112   ReportHandler::BuildTheRetObject    Number of column rows: 2
20190919.103425 D   16112   ReportStorage::DoQuery  Finished building the response
20190919.103425 I   16112   QBSDKMsgSetHandler  Request 9 completed successfully.
20190919.103425 I   16112   QBSDKMsgSetHandler  QUERY: General Summary Report
20190919.103425 D   16112   ReportStorage::DoQuery  Processing request for report: ProfitAndLossByJob
20190919.103425 D   16112   ReportStorage::DoQuery  Setting report type
20190919.103425 D   16112   ReportStorage::DoQuery  Initializing report defaults
20190919.103425 D   16112   ReportStorage::DoQuery  1st override of defaults
20190919.103425 D   16112   ReportStorage::DoQuery  Initializing report
20190919.103425 D   16112   ReportStorage::DoQuery  2nd override of defaults
20190919.103425 D   16112   ReportStorage::DoQuery  Generating the report
20190919.103425 E   16112   ReportHandler::GenerateReport   Unable to generate the report
20190919.103425 I   16112   QBSDKMsgSetHandler  Request 10 failed.

Solution

  • I was able to figure out a way to condense the multiple reports I wanted into one large report, but this is a workaround and won't always be a possible solution.

    It seems that there is a 10 report limit per response, so the solution here would be to do the reports in batches of 10. If anyone finds out something otherwise, I'll be happy to mark it as the correct answer.