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)

Create View - Exclude contacts Not Eligible using Link Entity

(0) ShareShare
ReportReport
Posted on by 214

Hi All,

I'm trying to create a view using Advanced Find which will exclude contacts who are not eligible for the study. I have a custom entity volunteerauditnew which holds all the studies a contact has been assessed for and the final status.

For certain contacts, if they are marked as NOT Eligible for a study, a workflow runs which will reset the study field to blank and status is updated to Available after 30 days. These contacts reappears in the study view since the status is now Available. 

To hide contacts who have been marked as Not Eligible from reappearing in the Study View after 30 days, I'm trying to Join the Contact entity with the volunteerauditnew entity and exclude contacts where the Not Eligible date is NOT NULL using the Advanced Find query.

I'm not getting the desired result as the contacts who are not eligible are still showing in the Study View

4478.advancedfindquery.JPG

The contacts highlighted below in the view should not appearing in the View as there status is Not Eligible and as we can see in the volunteerauditnew table the noteligibledate column has a date value .

Contacts in View

Id Full Name Conditions Contact Status Created On
409f1dff-bcbc-e911-b083-00155d264e5f Jag G Test Asthma Available 12/08/2019 04:52
2f5a9101-adb2-e911-b083-00155d264e5f Jim Asthma Available 30/07/2019 09:32
1eaec299-83af-e911-b083-00155d264e5f Jul26 TEST Asthma Available 26/07/2019 08:58
b3c1cba0-b0bd-e911-b083-00155d264e5f RS C Test Asthma Available 13/08/2019 09:56

volunteerauditnew records

Id studyid volunteeridid name createdon noteligibledate
6268b6ff-bcbc-e911-a878-000d3ae0e65e   409f1dff-bcbc-e911-b083-00155d264e5f Jag G Test 12/08/2019 04:52  
3a662c98-bfbc-e911-a872-000d3ae0e4ef debbf603-107a-e911-a84f-000d3ae0b82e 409f1dff-bcbc-e911-b083-00155d264e5f Jag G Test 12/08/2019 05:11 12/08/2019 05:11
89349a70-efbc-e911-a878-000d3ae0e65e 2939e9a1-5eed-e811-a843-000d3ae0c995 409f1dff-bcbc-e911-b083-00155d264e5f Jag G Test 12/08/2019 10:53  
db04dfed-fbbc-e911-a878-000d3ae0e65e 63ac9f50-69b2-e911-a85f-000d3ae09197 409f1dff-bcbc-e911-b083-00155d264e5f Jag G Test 12/08/2019 12:23 12/08/2019 12:27
562cddd4-6fb2-e911-a872-000d3ae0e4ef 63ac9f50-69b2-e911-a85f-000d3ae09197 5f0b8898-6fb2-e911-b083-00155d264e5f Part1 Study C 30/07/2019 02:15  
959987e5-24bf-e911-a870-000d3ae0eb8e 63ac9f50-69b2-e911-a85f-000d3ae09197 b3c1cba0-b0bd-e911-b083-00155d264e5f RS C Test 15/08/2019 06:21 15/08/2019 06:22

I also tried using xrmtoolbox to edit the linktype to outer as shown below but that did not work.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="contact" >
<attribute name="fullname" />
<attribute name="contactid" />
<attribute name="volunteerstudyid" />
<attribute name="createdon" />
<order attribute="fullname" descending="false" />
<filter type="and" >
<condition attribute="registrationtype" operator="eq" value="0" />
<condition attribute="multiselectcondition" operator="eq" value="2" />
<condition attribute="volunteerstudyid" operator="null" />
</filter>
<link-entity name="volunteerauditnew" from="volunteeridid" to="contactid" link-type="outer" alias="ad" >
<filter type="and" >
<condition attribute="noteligibledate" operator="null" />
<condition attribute="studyid" operator="eq" uiname="Research Study C" uitype="study" value="{63AC9F50-69B2-E911-A85F-000D3AE09197}" />
</filter>
</link-entity>
</entity>
</fetch>

Any ideas how I can create a view using advanced find or xrmtoolbox to exclude contacts who have a NotEligible date in volunteerauditnew Entity?

Thanks

Jag

*This post is locked for comments

I have the same question (0)
  • snearbar Profile Picture
    on at

    I have 2 things you can try:  1) The easiest is if you have Dynamics 365 Marketing and create a Segment.  Segment management has pretty straightforward ways to manage this.  2) Without Segments, you do still have the ability to make a Marketing List from these Contacts.  What you'd do is make a static list with the initial view of all your study contacts.  You'd then remove members who are in the Not Eligible view to get your Eligible Contacts.  Good luck!

  • Jag S Profile Picture
    214 on at

    Thanks Bart but would the marketing module require license. We have developed a custom Volunteer module and the will be using team member license.

    The view will be shared with different research teams which allows them to screen  Volunteers for their study. If a volunteer is not eligible during the screening process, the status will be changed to NOT Eligible so the volunteer is filtered out from the view.

    Based on a business requirment we have a worflow which triggers for certain volunteers that will change the Not eligible status to Available. When this happens the volunteer reappears in the View. 

    Since we have a custom audit entity cannot we join contact entity with audit entity in the advanced find to filter out not eligible contacts for a study?

    Thanks

    Jag

  • Bart Sneary Profile Picture
    14 on at

    If you're trying to do an outer join or exclude, wouldn't you want to use the linked records where the "Not Eligible Date" contains data?  I'm honestly not a FetchXML guy, but think that would be the right logic in your case.

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