Показать сообщение отдельно
Старый 05.11.2013, 18:32   #12  
spectr is offline
spectr
Участник
Аватар для spectr
MCBMSS
Лучший по профессии 2014
 
287 / 70 (3) ++++
Регистрация: 19.10.2011
Адрес: Киев
Ни в первом ни в втором нет возможности.
Сделать запрос retrieveMultiple получить первую страницу и линк на вторую.
Оно забирает все или только $top причем в втором XrmSvcToolkit.js если retrieveMultiple async == false то он вернет только первую страницу:
Код:
var retrieveMultiple = function (opts) {
        if (!isNonEmptyString(opts.entityName)) {
            throw new Error("entityName parameter was not provided. ");
        }

        var odataQuery = "";
        if (opts.odataQuery != null) {
            if (!isString(opts.odataQuery)) {
                throw new Error("odataQuery parameter must be a string. ");
            }

            if (opts.odataQuery.charAt(0) != "?") {
                odataQuery = "?" + opts.odataQuery;
            } else {
                odataQuery = opts.odataQuery;
            }
        }

        var restReq = {
            url: clientUrl + odataEndpoint + "/" + opts.entityName + "Set" + odataQuery,
            type: "GET",
            async: !!opts.async
        };

        return doRestRequest(restReq, function (result) {
            if (isFunction(opts.successCallback)) {
                opts.successCallback(result.results);
            }

            if (!opts.async) {
                return result.results;
            }

            if (result.__next != null) {
                opts.odataQuery = result.__next.substring((clientUrl + odataEndpoint + "/" + opts.entityName + "Set").length);
                retrieveMultiple(opts);
            } else {
                if (isFunction(opts.completionCallback)) {
                    opts.completionCallback();
                }
            }
        }, function (err) {
            if (isFunction(opts.errorCallback)) {
                opts.errorCallback(err);
            } else {
                throw err;
            }
        });
    };