Skip to content

returnAllPages = true #37

@phuocle

Description

@phuocle

Hi @DigitalFlow

Yesterday our FetchXml request has setting returnAllPages = true; and it ok. The return result about 2,000 rows, but we understand in feature it maybe more than 5,000 rows that why we set this value.

But today, i get an error when execute the same query, I'm sure nothing change from yesterday.
Now, if I change the setting returnAllPages = false; and it ok again. wwowowow.

Look at the core js and i found maybe something wrong in the checking condition

...
            var nextLink = GetNextLink(response);
            var pagingCookie = GetPagingCookie(response);
            response = MergeResults(parameters._previousResponse, response);
            // Results are paged, we don't have all results at this point
            if (nextLink && (WebApiClient.ReturnAllPages || parameters.returnAllPages)) {
                SetPreviousResponse(parameters, response);
                SendSync("GET", nextLink, null, parameters);
            }
            else if (pagingCookie && (WebApiClient.ReturnAllPages || parameters.returnAllPages)) {
                var nextPageFetch = SetCookie(pagingCookie, parameters);
                SetPreviousResponse(parameters, response);
                parameters.fetchXml = nextPageFetch;
                WebApiClient.Retrieve(parameters);
            }
}

The first if passed because the nextlink is undefined
The second else if will run because pagingCookie now have value with setting returnAllPages = true; or returnAllPages = false; and the exception throw in the method SetCookie

I guest something change from the response, so the function GetPagingCookie always has data.

Note: I'm using async = false;, return rows <2,000 rows, setting returnAllPages = true;

Please help review my issue and thanks for a great WebApi, we love it and use it in all company projects.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions