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)

How to detect a "Lead" attribute change and update external database

(0) ShareShare
ReportReport
Posted on by 925

Hello,

We have an external database that will hold e-mail information and all subscription preferences like promotional email, bulk email, etc.

When a change is done on field "Allow E-mail", we would like to trigger the same change on that external database.

Any trail of solution?

I was thinking of creating a database field trigger on the LeadBase table that would connect to that external database which would reside on a separate server.

Thanks in advance.

Best regards,

J-P

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Hosk Profile Picture
    on at

    I wouldn't recommend a database change because this is an unsupported change (any change directly to the database is)

    I would create a plugin which could update the external database (I am assuming you are trying to update the external database after a field has changed in CRM).  The plugin could connect and then update the other database and could be triggered in CRM on update of contact and then checking to see if the "Allow E-Email" field has changed

  • Kitco Profile Picture
    925 on at

    Hmmm what type of plugin?  Specific SDK for this?

  • Verified answer
    Hosk Profile Picture
    on at

    You would need to write a plugin to be triggered on the update event for the contact.

    You will need to download the CRM SDK

    Here is the sdk version

    msdn.microsoft.com/.../gg328263(v=crm.6).aspx

    some other useful material

    mscrmshop.blogspot.co.uk/.../step-by-step-plugin-tutorial-using.html

    www.youtube.com/watch

  • Kitco Profile Picture
    925 on at

    Very nice! Thank you!

    Another question though, how can you check for a particular field change?

    In the various examples I've found, it was simply checking if entity was created, modified or deleted.

    Thanks in advance.

  • Verified answer
    Hosk Profile Picture
    on at

    When you have a plugin running on an update, only the fields that have changed have a value.

    You check to see if the allow email is not null otherwise you exit the plugin and do nothing

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