Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

XrmServiceToolkit.Rest.RetrieveMultiple retrieve records with all attributes even if there is selected attribute

(0) ShareShare
ReportReport
Posted on by 145

Hi,

i'm using XrmServiceToolkit.Rest.RetrieveMultiple to retrieve records of 'new_programcourseprerequisitesentity' entity , i want to only return one attribute which is 'new_failurethresholdgrade'. The problem is that records returned with all attributes. 

here is my code:

var result = null;
XrmServiceToolkit.Rest.RetrieveMultiple('new_programcourseprerequisitesentitySet', '&select=new_failurethresholdgrade', function (r)
{
result = r;
}, nop, nop, false);

Any idea?

  • Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: XrmServiceToolkit.Rest.RetrieveMultiple retrieve records with all attributes even if there is selected attribute

    As both Ravi and Goutam state you really should stop using the XrmServiceToolkit it uses the CRM 2011 SOAP interface that is deprecated and is likely to be removed in a future release (possibly in the very near future) so unless you are running an old (2015 or older) on premise release you really do need to be moving to using the web api and the CRMRestBuilder will generate the Javascript code you need automatically....

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 Moderator on at
    RE: XrmServiceToolkit.Rest.RetrieveMultiple retrieve records with all attributes even if there is selected attribute

    Hi,

    You can also refer this blog on retrieving multiple records using XrmService toolkit however I do agree with Goutam's suggestion to use web api instead if you can.

    crm2011and2013solutions.blogspot.com/.../retrieve-multiple-records-using.html

    Hope this helps.

  • Verified answer
    gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: XrmServiceToolkit.Rest.RetrieveMultiple retrieve records with all attributes even if there is selected attribute

    Hi Khaled, 

    Try with this  -

                    var selectQuery = "?$select=new_failurethresholdgrade";
                    XrmServiceToolkit.Rest.RetrieveMultiple(
                        "new_programcourseprerequisitesentitySet",
                        selectQuery,
                        function (results) {
                            result = results;
                        },
                        function (error) {
                        },
                        function onComplete() {
                        },
                        false
                    );


    In addition which version of CRM you are using ? I would recommend instead of depending on additional library (XrmServiceToolKit) , use CRM API , download the CRMRestBuilder and import the solution in CRM instance . You can generate your query using tool. So you dont have to write manually code.

    https://github.com/jlattimer/CRMRESTBuilder/releases

  • Suggested answer
    DaveBurrell Profile Picture
    DaveBurrell 260 on at
    RE: XrmServiceToolkit.Rest.RetrieveMultiple retrieve records with all attributes even if there is selected attribute

    Rather than using a select you can use a columnset:

    var query = new QueryExpression("new_programcourseprerequisitesentitySet")

       {

           ColumnSet = new ColumnSet("new_failurethresholdgrade")

       };

       var results = service.RetrieveMultiple(query);

    There are other methods and examples that you can use here:

    docs.microsoft.com/.../retrieve-specific-columns-entity-via-query-apis

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans