Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM Workflow Process doesn't trigger on record created through Entity Framework

Posted on by Microsoft Employee

In Microsoft Dynamic CRM, I have a workflow process when a record is created.

When I create a new record using Entity Framework(EF), the workflow is not triggered. But it triggers fine when I create a record using Organization Service Proxy.

Below is my code to create a new record using EF.

Entity e = db.Entity.Create();
//
......
//
e.Entity.Add(e);
e.SaveChanges();

Above code works fine and it creates a new record. But it doesn't trigger the Workflow Process.

What could be the solution in this scenario?

*This post is locked for comments

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: CRM Workflow Process doesn't trigger on record created through Entity Framework

    Hi Hemanth Kumar M

    I assume you are using EF as an ORM to Dynamics CRM SQL Database.  If that is the case, the workflow will not trigger it will only trigger if you perform the operation using WCF / Web Api endpoints.

    First of all, I would like to mention this here that direct SQL Data or schema change is not supported, as outlined in the page below

    "Data (a record) changes in the Dynamics 365 for Customer Engagement database using SQL commands or any technology other than those described in this documentation" not supported

    [View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/supported-extensions#unsupported-customizations:750:50]

    I would highly recommend you implement your solution via endpoints not by directly connecting to SQL DB. 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM Workflow Process doesn't trigger on record created through Entity Framework

    Using the EntityFramework and not the Organization Service Proxy so service.create(e) cannot be used

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: CRM Workflow Process doesn't trigger on record created through Entity Framework

    Use service.create(e); instead of e.SaveChanges();

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans