Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portal - Display View with "contain-values" filter

(0) ShareShare
ReportReport
Posted on by 112

Hi

We are currently running into issues when trying to display a view that uses "contain values" filter (multiselect)

Portal currently doesn't seem to support this new filter

I am just wondering if anybody has idea/workaround for this issue?

*This post is locked for comments

  • Verified answer
    boomboomroom Profile Picture
    112 on at
    RE: Portal - Display View with "contain-values" filter

    thank you for your reply. we'll probably go with option #3 as #1 and #2 does not seems feasible for us

    we do have a lot of options so yeah it will be a long fetchxml

  • Verified answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at
    RE: Portal - Display View with "contain-values" filter

    Hello,

    Have checked your case, and definitely its not-implemented functionality on the portal. Concrete error saying "Sequence contains no matching element" which lead into .net liquid debris.

    And there is no simple workaround for this.

    I can think of next:
    1) create an additional text field and whenever you set multi-select filed -  put to this text field its value in string format (you can do it with a custom plugin, or with simple JavaScript on the form, if you are changing it only at the form )

    Then you can create view "contains" you value. 

    2) You can use SDK or WebAPI (docs.microsoft.com/.../multi-select-picklist) but because there is no clean pattern of server-side code in the Portals - you probably need to create additional service just for this. Again its possible implement emulation of Portal server side code like described here: https://uds.systems/2017/03/20/how-to-run-custom-code-in-dynamics-365-portal/

    3) The quickest solution - is to change filter criteria in the view from "contains values" to "in", but for many options in multi-select it will be quite complicated:
    So instead of 

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="account">
        <attribute name="name" />
        <attribute name="numberofemployees" />
        <attribute name="accountid" />
        <order attribute="name" descending="false" />
        <filter type="and">
          <condition attribute="new_multioption" operator="contain-values">
            <value>100000000</value>
          </condition>
        </filter>
      </entity>
    </fetch>


    in my example for the field "new_multioption" with three values, I need to change it to 

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="account">
        <attribute name="name" />
        <attribute name="numberofemployees" />
        <attribute name="new_multioption" />
        <order attribute="name" descending="false" />
        <filter type="or">
          <condition attribute="new_multioption" operator="in">
            <value>100000000</value>
          </condition>
          <condition attribute="new_multioption" operator="in">
            <value>100000000</value>
            <value>100000001</value>
          </condition>
          <condition attribute="new_multioption" operator="in">
            <value>100000001</value>
            <value>100000002</value>
            <value>100000000</value>
          </condition>
          <condition attribute="new_multioption" operator="in">
            <value>100000000</value>
            <value>100000002</value>
          </condition>
        </filter>
      </entity>
    </fetch>

    ===
    You can update the view by creating a simple solution, exporting it, changing the fetchxml for the view, and importing this back.  This will work at the Portals OOB, but you hardly can change it in CRM UI.

    Thanks, Dmytro.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans