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 set trigger to CRM Contact base table

(0) ShareShare
ReportReport
Posted on by

I have created one Trigger in CRM Contactbase table, whenever an Insert/Update happens in Contactbase table this trigger will Update/Insert the same data in the another table on another database. This trigger working fine without any error when manual update happens in SQL, but when i update the field in contact entity form it troughs me SQL error .

I get to know that trigger wont work in CRM database tables, But in production it working fine with trigger in CRM table. Facing issues only in non-prod environment. Is there any other way to achieve this SQL trigger to work in CRM ?

*This post is locked for comments

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at

    First of all doing changes in CRM database is completely unsupported. Why not you write plugin and services or windows batch job to push data to another database instead doing unsupported way.

  • Community Member Profile Picture
    on at

    Yes you are correct but in my client machine, they are already having one trigger enabled in the Contact base table. It working fine Update/Insert  to another database table. But in non-prod they kept that trigger in disable mode. I got the change requirement for that trigger now, but i don't know how to validate it after my change made in trigger without affecting the CRM functionality.

  • Community Member Profile Picture
    on at

    Also i have noted one-thing, If i created table in the CRM means the trigger working fine, if i created table in different database means trigger through error.

  • Verified answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    Doing any development in data base and update any record in database directly is highly unsupported.

    It is better to go back to your client and say that what ever development is there is unsupported and we have to do all requirement in supported way.

  • David Jennaway Profile Picture
    14,065 on at

    I completely agree with the previous post that you should try and replace this with supported functionality. That said, if you only get the error when the custom table is in another database, then the likely issue is SQL permissions. CRM does all data operations via a login that's a member of the SQLAccessGroup AD group, so you'll need to be sure that login has rights to update your custom table

  • Community Member Profile Picture
    on at

    Hi David, I am having access to those two database. If setting trigger in CRM table is unsupported means then i am confused how its working in my client Production machine. Anything i am missing.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    It may work or may not work there is no guaranty and completely depends on your luck , and you can not say why its not working ,as we don't know how Microsoft Dynamics internally works , what are the procedure and trigger internally there in SQL database. Writing trigger in database which  may impact CRM system unknowingly. I have similar experience somebody wrote trigger in CRM database and found many issues for that even the systems running properly more than three months and we came to know later when all our data got impacted due to this . So strongly recommend not to write trigger.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    In addition to above, you can share the below documentation from Microsoft which states that it is unspoorted to change the SQL schema other than adding indexes.

    docs.microsoft.com/.../supported-extensions

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