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 :
Customer experience | Sales, Customer Insights,...
Answered

Automatically add filter on dynamic marketing lists

(0) ShareShare
ReportReport
Posted on by

Hi, 

We have several sales companies in different countries working in the same Dynamics 365 sales environment, they are separated with Business units and security roles and can only see records owned by users inside their business unit.

We have just connected an email marketing tool to send out emails to contacts in our marketing lists. Our problem is that when a user creates a new dynamic marketing list they always need to add a filter to make sure that contacts only from their business unit are added (for example: Owning business unit - Equals - Company A) otherwise when the marketing list are synchronized to the email marketing tool, it will only check the filter and add all contacts who is matching the filter to a recipient list in the email marketing tool, independent on which business unit the contacts are from. This has resulted in some sales companies sending out emails to all contacts in the whole system by mistake, because they forgot to add the filter to filter our only their own contacts from their business unit. 

Is there any way to add a filter automatically? I know that I can use views with filters but I don't think that will help that much since it is still dependent on manual work and it can bee forgotten to select a view as well. 

Or do you have any other ideas to work around this?

Thanks in advance!

Best Regards

I have the same question (0)
  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Emma,

    Thank you for your query.

    I tried reproducing your scenario:

    • Test User has Salesperson role and allowed to see Accounts within current Business Unit.
    • Create a Dynamic Marketing List targeting Accounts.
    • Find Members and the user only sees Accounts in Current Business Unit (as expected).

    For your reference, adding screenshots.

    When my user have Organization Level Read on Accounts (Dynamic Marketing List have accounts from current BU):

    pastedimage1609828045359v1.png

    When my user have Business Unit Level Read on Accounts (Dynamic Marketing List have all accounts):

    pastedimage1609828170746v2.png

    In my case this is working fine, can you please make sure the users creating Marketing List has BU level read access on Contacts?

    Let me know your findings.

    Best,

    Wahaj

  • EmmaCRMadmin Profile Picture
    on at

    Hi Wahaj,

    Sorry I was not so clear in my description. The users can see the correct contacts/accounts/leads when they create a filter for a dynamic marketing list. The problem is when we synchronize the marketing list to our email marketing tool. There is a "system user" between the two systems who are automatically looking at the marketing list, checking the filter and then taking all contacts who are matching the filter. This "system user"must have admin access and that is where the problem comes, because then it will access all contacts who are matching the filer, not only the contacts who the user can see. So that is why the users need to add this extra filter everytime, so that this system user is returning the correct contacts in to the email marketing tool. That is why I wish to do something which needs less or no manual work to make this work.

    As you can imagine it is quite easy to forget to add a filter, and then maybe if someone who is not used to work with the system log on to the email marketing tool to send a newsletter,  then the email is sent to a loooot of contacts in different countries.

    Best Regards,

    Emma

  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi Emma,

    Your idea inspired me to play with Dynamic Marketing Lists and I have a solution:

    • Create a plugin that runs on pre-create of Marketing List entity.
    • If the list type is dynamic, prepare FetchXML (with BU filter) based on the Target Entity.
    • Assign the FetchXML to query column of Marketing List entity.

    In result, when users create Dynamic Marketing Lists, Business Unit filter is already added.

    I have blogged the solution with sample code here:

    https://crmlogs.wordpress.com/2021/01/06/dynamics-365-ce-pre-filtering-on-dynamic-marketing-list/

    You can improve this solution by getting FetchXML from a SavedQuery (View) instead of preparing yourself.

    Let me know your thoughts!

    Best,

    Wahaj

    (if it helps, please mark this answer as verified)

  • EmmaCRMadmin Profile Picture
    on at

    Wooow amazing!! This is exactly what we need. Thank you so much for you help, I will go straight in and play around with your code.

    Best Regards,

    Emma

  • Wahaj Rashid Profile Picture
    11,321 on at

    My pleasure :)

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans