locked
Filter Team lookup CRM 2013 RRS feed

  • Question

  • Hi,

    I'm trying to filter a team lookup in CRM 2013 with following filter.

    var filter = "<filter type='and'>"
                + "<condition attribute='businessunitid' operator='in'>"
                + "<value uitype='team'>{D9F2AF7C-9C2E-E411-A53A-00155D5248A4}</value>"
                + "<value uitype='team'>{CFF2AF7C-9C2E-E411-A53A-00155D5248A4}</value>"
                + "</condition>"
                + "</filter>"

    Xrm.Page.getControl("a_owningteamid").addCustomFilter(filter);
    Is not apply and I think the problem migth be I'm using an IN filter.

    Wednesday, September 3, 2014 3:14 PM

Answers

  • Does this help? - Please replace contact with Account.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
        <entity name="incident" >
            <attribute name="ticketnumber" />
            <link-entity name="contact" from="contactid" to="customerid" alias="ad" >
                <link-entity name="businessunit" from="businessunitid" to="owningbusinessunit" alias="ae" >
                    <link-entity name="team" from="businessunitid" to="businessunitid" alias="af" >
                        <attribute name="name" />
                        <attribute name="businessunitidname" />
                        <attribute name="isdefault" />
                        <filter type="and" >
                            <condition attribute="name" operator="not-null" />
                        </filter>
                    </link-entity>
                </link-entity>
            </link-entity>
        </entity>
    </fetch>

    Friday, September 5, 2014 12:32 AM

All replies

  • Hello JSR,

    Is the condition attribute name correct? I see that you use businessunitid ?

    <condition attribute="teamid" operator="in">

    Regards,

    Jithesh.K

    Thursday, September 4, 2014 4:35 AM
  • Yes it is. I'm filtering by busninesunitid
    Thursday, September 4, 2014 7:58 AM
  • Could you provide some more information about your requirement, so that some one help you ??

    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, September 4, 2014 8:12 AM
    Moderator
  • It's a Team lookup, and I want a filter to show only teams where:

    - Their businesses unit is the same as the Account Business unit selected in a Case.

    or

    - Their business unit type is equal to 1

    First I was trying to set up the view as explained here http://social.microsoft.com/Forums/en-US/652876d4-a996-4d45-b5aa-0eb64717f2b9/addcustomview-in-crm-2013-lookup?forum=crmdevelopment

    But as I couldn't, I want to apply filter first.

    • Edited by RDevelopment Thursday, September 4, 2014 8:48 AM
    Thursday, September 4, 2014 8:43 AM
  • Hi Jsr,

    if you open a user record, there is an associated team relationship. Shows the team a user belongs and also the default bu team. You might be able to leverage on that to meet your query. I am not near a machine right now.

    regards

    Jithesh

    Thursday, September 4, 2014 12:23 PM
  • Thanks, but that filter is only to show teams in the same business unit.

    What I'm trying to do is:

    First, in a Case record, choose an Account, and set up the Team lookup depending on the Account value.

    So I get the businessunitid of the Account, and all the Teams that belong to that Business Unit. Also I need to show Teams that belong to root Business Unit.

    Thursday, September 4, 2014 1:45 PM
  • Does this help? - Please replace contact with Account.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
        <entity name="incident" >
            <attribute name="ticketnumber" />
            <link-entity name="contact" from="contactid" to="customerid" alias="ad" >
                <link-entity name="businessunit" from="businessunitid" to="owningbusinessunit" alias="ae" >
                    <link-entity name="team" from="businessunitid" to="businessunitid" alias="af" >
                        <attribute name="name" />
                        <attribute name="businessunitidname" />
                        <attribute name="isdefault" />
                        <filter type="and" >
                            <condition attribute="name" operator="not-null" />
                        </filter>
                    </link-entity>
                </link-entity>
            </link-entity>
        </entity>
    </fetch>

    Friday, September 5, 2014 12:32 AM