How to return a value from RetrieveMultiple

Coordinator
Apr 12, 2012 at 9:17 AM

Hi,

It seems that RetrieveMultiple method use a success function as parameter.

What if I want the method that uses RetrieveMultiple to return the values from that RetrieveMuliple call?

How to write it?

Coordinator
Apr 18, 2012 at 9:46 AM

Hey There. I have put an example about using RetrieveMultiple example in the updated documentation in the aspx test page...Please have a look.

  test("Test XrmServiceToolkit.Rest.RetrieveMultiple(contact) method to get the contacts", function () {

            XrmServiceToolkit.Rest.RetrieveMultiple(
                "ContactSet",
                "$select=ContactId, FullName",
                function (results) {
                    ok(results.length > 0, results.length.toString() + " records should have been retrieved.");
                },
                function (error) {
                    equal(true, false, error.message);
                },
                function onComplete() {

                },
                false
            );
        });
Apr 18, 2012 at 11:04 PM
Edited Apr 18, 2012 at 11:05 PM

Hi jaimieji,

I think what tanguy92 mean is if we can do coding as follow:

var results = XrmServiceToolkit.Rest.RetrieveMultiple('AccountSet', "?$filter=StateCode/Value eq 0", null, null, null);

instead of using a success function as parameter, return results synchronously.

May 3, 2012 at 11:15 PM
hjmhyl wrote:

Hi jaimieji,

I think what tanguy92 mean is if we can do coding as follow:

var results = XrmServiceToolkit.Rest.RetrieveMultiple('AccountSet', "?$filter=StateCode/Value eq 0", null, null, null);

instead of using a success function as parameter, return results synchronously.


Hi jaimieji,

In you next release(1.5), it would be great if we can do code as I quoted.

Aug 28, 2014 at 8:40 AM
Hi,

I think it is an old question asked by @tanguy92, but I want to do the same:

var results = XrmServiceToolkit.Rest.RetrieveMultiple('AccountSet', "?$filter=StateCode/Value eq 0", null, null, null);


how could i do this ? Is the library updated now ?
Coordinator
Oct 6, 2014 at 1:35 PM
Hi There.

Not for Rest at the moment.

Kind Regards,
Jaimie