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)

Trigger to run Console Application from CRM Database ?

(0) ShareShare
ReportReport
Posted on by

It's possible to create a trigger in CRM 365 Database that fire console application everytime a new record is created in CRM ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sergio Macias Profile Picture
    225 on at

    Hi Fikri Microsoft does not recommend alter the CRM database as you can lose its warranty, but what I can suggest to you is:

    If you want to execute server code or code that you already have in your console you might want to use a Plugin, plugins can execute server code.

    Or in case your console is a must, I will recommend one more time to use a Plugin but this time insert the record in an intermediate database so you don't have to alter the CRM Database.

    If you give me more details on what you want to do I can think on more workarounds

  • Community Member Profile Picture
    on at

    Hi Sergio, 

    We want to synchronize our CRM 365 On-Premise with CRM Online using this scenario:

    In CRM Online, when a new opportunity records is created, the system will send email to an account in CRM 365 On-Prem that contain opty number (unique field) of the new created opportunity. Using Auto Case Creation in CRM 365 On-Prem, we will created a new opportunity record based on opty number we recieve from CRM Online in email. Since the email just contain opty number, the rest of opportunity fields are still empty.

    In order to get the rest data of opportunity records (opty name, owner, createdon and etc) in CRM Online, we creating a plugin that will get the data from CRM Online based on the opty number, and updating CRM 365 On-Premise with those data. But, in the middle of work, we knew that plugin won't work for our CRM system, due to proxy setting within our organization. 

    So we want to use console app that get opty number and guid in database, and do query to retrieve records in CRM Online based on opty number, and update the recordsi in CRM 365 On-Prem based on its guid.

  • Sergio Macias Profile Picture
    225 on at

    Fikri I get your point, I can think in two different options

    Int1.JPGInt2.JPG

  • Community Member Profile Picture
    on at

    So i need to write plugin that sent records into another (temporary) SQL Database, not the CRM Database itself ? And create trigger within this temporary database to run my console application ?

    By the way, I have tried to register my console in the CRM Database, and create Trigger in this database. Then i test this trigger by creating a records in CRM. But i think  that the trigger not working, because when i check to the newly created record, its not updated like i want.

    I think that the trigger not detect insert process from CRM application. Is it ? I need the right reason why  the trigger not working in this case. So i can tell my boss to use your suggestion.

  • Verified answer
    Sergio Macias Profile Picture
    225 on at

    Fikri the SQL database works as any other database, it has a special structure but it works as any other, If you want to find a correct reason to not edit the database and look for other workarounds please see this link :

    community.dynamics.com/.../solid-reason-39-s-not-to-do-direct-database-t-sql-operations-on-dynamics-crm-database-from-the-pros

    I didn't find a link to a microsoft site, but editing the database for CRM is no supported, this is the main reason to see other options, the proxy you have on you organization need to have an execption to permit the communication between one server to the other

  • Verified answer
    Nicolas.Plourde Profile Picture
    240 on at

    You can't add anything to the database. But you could use Microsoft Flow to automate a process between two systems.

    flow.microsoft.com/fr-fr

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