2
We use Dynamics 365 (Version 1612 (8.2.26.14) (DB 8.2.26.14) on-premises).

We have a need to intercept the contacts that users attempt to add to marketing lists, so we can filter out unwanted contacts, such that the unwanted contacts are never added to the marketing list. We tried to accomplish this with a plugin that is triggered on the "AddMember" and "AddListMembers" messages.

The problem we ran into is that users who add members to a marketing list by clicking Manage Members > Advanced Find, and then selecting the "Add all the members returned by the search to the marketing list" option, manage to bypass the "AddMember" and "AddListMembers" triggers, so our plugin doesn't get fired, and unwanted contacts can be added to the marketing list.

Our research into this issue, and discussions with Microsoft Support, revealed that there used to be a message that was triggered on that event, called "AddMembersByFetchXml". However, this message was made private in 2015, apparently due to performance considerations.

This leaves a hole, where there is no way to hook members added to a marketing list in that manner and run a plugin on them.

We were given suggestions by Microsoft Support on how to handle this issue. Such as building views/Advanced Find filters that exclude the contacts we don't want on the marketing lists, or running a plugin on the "Update" message, and removing unwanted contacts from a marketing list after they have been added. The first option won't work because our users construct their own queries for contacts to add to marketing lists, and we can't enforce that they include our restrictions. The second option won't work because contacts being added to a marketing list triggers third-party components that send out marketing materials immediately, so removing the contacts from the list occurs too late and unwanted contacts have already been sent materials.

If the "AddMembersByFetchXml" message were made available again, that would give us the hook we need. We are not especially concerned with the performance, as the plugin validation of contacts that we do is already a slow process; but necessary for us, for legal reasons.

Alternately, if some other method of hooking the event of contacts being added to a marketing list in this manner could be made available, that would satisfy our need.

If nothing can be done to hook that event, minimally we would like the option to remove the "Add all the members returned by the search to the marketing list" from the Manage Members > Advanced Find dialog, such that users cannot bypass our plugin.
STATUS DETAILS
Needs Votes