locked
ODATA $Expand Team names of User RRS feed

  • Question

  • I havent had any success with ODATA $expand to get related records.  I have used the codeplex tool as well.   

    I NEED NAMES OF ALL TEAMS THAT A USER BELONGS TO.

    I have played around with URL like this

    xrmservices/2011/OrganizationData.svc/SystemUserSet?$select=teammembership_association/Name&$expand=teammembership_association

    Can someone send me the ODATA URL for this?

    Temporarily I am using 2 reads to get the information.

    Thanks in Advance.

    Monday, March 18, 2013 10:36 PM

Answers

  • Actually the above URL I posted works.

    I just had to go through the results returned to reach what I wanted.

            if (results[i].teammembership_association != null && results[i].teammembership_association.results != null) {

                var teams = results[i].teammembership_association.results;

                for (j = 0; j < teams.length; j++) {

                    var TeamName = teams[j].Name;

    The ODATA tools doesn’t seem to work with $expand in my opinion.  Happy to be corrected.

    • Marked as answer by SydneyXrm Wednesday, March 20, 2013 12:02 AM
    Wednesday, March 20, 2013 12:02 AM

All replies

  • Hi, try this /xrmservices/2011/OrganizationData.svc/TeamSet?$select=TeamId,teammembership_association/FullName&$expand=teammembership_association

    BTW: Have a look at this utility, http://crm2011odatatool.codeplex.com/ it's very useful in terms of oData syntax.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    Tuesday, March 19, 2013 8:23 AM
  • in below link is odata query designer 

    http://crm2011odatatool.codeplex.com/releases/view/62066

    by using this tool can create the query in more easy way...


    ms crm

    Tuesday, March 19, 2013 8:23 AM
  • Actually the above URL I posted works.

    I just had to go through the results returned to reach what I wanted.

            if (results[i].teammembership_association != null && results[i].teammembership_association.results != null) {

                var teams = results[i].teammembership_association.results;

                for (j = 0; j < teams.length; j++) {

                    var TeamName = teams[j].Name;

    The ODATA tools doesn’t seem to work with $expand in my opinion.  Happy to be corrected.

    • Marked as answer by SydneyXrm Wednesday, March 20, 2013 12:02 AM
    Wednesday, March 20, 2013 12:02 AM