Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics CRM code

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

when a Customer changes their email preferences that the same preferences are replicated for all Contact records with the SAME EMAIL ID.This means if nisha@af.com changes it's email preferences to Opt-Out of all organization emails,this should be udpated in all Contact records that have the same email ID.Please help to write the plugin for me please.Fields' schema names are ----

acc_\promotionalemails

acc_smsmessages

acc_updates

acc_marketingmessages

acc_letters

acc_unsubscribeemails

Source and target both are contact

The plugin should fire on the change of fields on the contact entity. Then it should look for all the records with the same email in the contact entity. Loop through all the records and update the preferences.

Can anyone please help me with the C# code please.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics CRM code

    To be more specific this is the need:

    we need to check , if one contact, changes the email preferences, whichever contact is having the same email id, for all those contacts the email preferenes shud update

    eg: suchi (suchigs@aa.com) i have changed all the contact pref to yes, and i have 2 contacts 1. suchigs 2. suchi and same email id.. so in these 2 contacts the contact pref should become "YES" for the all the 6.

    {lease write the code for me....

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics CRM code

    Can anyone please help me with the code please

  • Suggested answer
    Flydancer Profile Picture
    Flydancer 1,332 on at
    RE: Dynamics CRM code

    Steps you have to do:

    1. Register plugin with update-step for your customer-entity (see community.dynamics.com/.../dynamics-crm-2016-custom-plugin-development-using-crm-development-tool-kit )

    2. Use RetrieveMultiple to retrieve all contacts where email is xx@xx.com (see msdn.microsoft.com/.../gg334208.aspx )

    3. Loop through results from RetrieveMultiple and update the records (see emtaletovic.wordpress.com/.../create-and-update-crm-records-using-c )

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,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans