web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Verified answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at

    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.

  • Verified answer
    boomboomroom Profile Picture
    112 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans