Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

Virtual Entity: Access the filter condition within the retrieve multiple plugin

(0) ShareShare
ReportReport
Posted on by 40

Hello!

I have a new virtual entity, which I am populating data from an external source with an api call. I have a subgrid within the case form, and I have a N:N relationship created with incident and this entity. The subgrid is for the related records. Therefore, when I load the subgrid, I see the fetchXML in network trace contains a filter condition wtih linked entity to incident, and has the incident number. However, the "Query" that I see from the plugin that this virtual entity data source-triggered retrievemultiple would trigger, doesn't contain the filter condition. The Linked Entity object is empty. 

fetchXml: <fetch version="1.0" mapping="logical" returntotalrecordcount="true" page="1" count="4" no-lock="false"><entity name="virtualentity"><attribute name="myorg_name"/><attribute name="myorg_title"/><attribute name="myorg_status"/><attribute name="myorg_severity"/><attribute name="myorg_owningid"/><attribute name="myorg_owningcontact"/><attribute name="myorg_modifieddate"/><attribute name="myorg_id"/><attribute name="myorg_createdate"/><attribute name="virtualentityid"/><link-entity name="myorg_virtualentity_incident" intersect="true" visible="false" to="virtualentityid" from="virtualentityid">
<link-entity name="incident" from="incidentid" to="incidentid" alias="bb">
<filter type="and">
<condition attribute="incidentid" operator="eq" uitype="incident" value="de5759c2-928a-ec11-8f97-0022487af2d6"/>
</filter>
</link-entity>
</link-entity></entity></fetch>

But what I get within the plugin is this:

{"Distinct":false,"PageInfo":{"PageNumber":0,"Count":0,"ReturnTotalRecordCount":false,"PagingCookie":null},"LinkEntities":[],"Criteria":{"FilterOperator":0,"Conditions":[],"Filters":[]},"Orders":[],"EntityName":null,"ColumnSet":{"AllColumns":false,"Columns":[],"AttributeExpressions":[]},"NoLock":false}

What am I missing here? Any insights will be appreciated. Thanks!

  • Chirita Cristian Profile Picture
    Chirita Cristian 10 on at
    RE: Virtual Entity: Access the filter condition within the retrieve multiple plugin

    Hello, I know this thread is old but I am going to post a way.

    First, you need to go to the quick find form view of the virtual entity and add the filtering columns.

    After that, you have two ways of it showing up in the code when you select filters for all of the filters that have the equals operator you can find them under query.Criteria.Conditions but for all the other operators you can find them under query.Criteria.Filters. With the second option, you have to get the conditions from each filter, a way to do that is by parsing through the array and getting the conditions for each filter.

    For example, when you select a date with the today operator it will only show up under the filters and it will be split into 2 conditions >= date time and <= date time. You have to parse through all the filters and add the ones you want to take into account.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans