locked
OData : Filter on related entity ? RRS feed

  • Question

  • Dear,

     

    Could you please tell me if it's possible to retrieve the list of Users part of a specific team via oData?

     

    I thought of an URL like this:

     

    /OrganizationData.svc/SystemUserSet?$select=FullName,teammembership_association/Name&$expand=teammembership_association&$filter=teammembership_association/Name = 'Team A'
    
    

    but it doesn't work.

     

    If you have any idea... :-)

     

    Thank you,

    Thursday, November 3, 2011 12:06 AM

Answers

  • Filter would work on related n:1 relations. So if team is a lookup on system user, you could apply filter on the name attribute. But if it is a 1:n relationship, you cannot filter based on the other entity.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, November 3, 2011 1:02 AM

All replies

  • Filter would work on related n:1 relations. So if team is a lookup on system user, you could apply filter on the name attribute. But if it is a 1:n relationship, you cannot filter based on the other entity.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, November 3, 2011 1:02 AM
  • Sam,

    Thank you for your input.

    Indeed, User and Team are native entities from CRM 2011.

    According to my undersrtanding, their relationship is N:N.

    Dos this mean it is not possible ?

    Thursday, November 3, 2011 11:58 PM