Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Trigger to run Console Application from CRM Database ?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

  • Verified answer
    Nicolas.Plourde Profile Picture
    Nicolas.Plourde 240 on at
    RE: Trigger to run Console Application from CRM Database ?

    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

  • Verified answer
    Sergio Macias Profile Picture
    Sergio Macias 225 on at
    RE: Trigger to run Console Application from CRM Database ?

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trigger to run Console Application from CRM Database ?

    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.

  • Sergio Macias Profile Picture
    Sergio Macias 225 on at
    RE: Trigger to run Console Application from CRM Database ?

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

    Int1.JPGInt2.JPG

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trigger to run Console Application from CRM Database ?

    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.

  • Suggested answer
    Sergio Macias Profile Picture
    Sergio Macias 225 on at
    RE: Trigger to run Console Application from CRM Database ?

    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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans