web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Auto excute Workflow when call method SaveChange() from plugin

(0) ShareShare
ReportReport
Posted on by 42

Hi all,


When I custom plugin for CRM system.

I have a workflow send email notification for user or team when that record has been changed field Owner as image below:

68576.Capture1.PNG

After that I custom plugin (Post-Operation) change status (field Option Set Value) with some conditions and call CrmServiceContext with method SaveChange() as image 2 below:

6084401.Capture.PNG

When I do something to change field status. After refresh browser, status had been changed. Beside, the workflow "Email Notification Account" auto run.

Result: When I do something to change status, owner of that record will receive a email --> Spam Mail.

Anybody have solution to help me resolve this problem?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    As for me the easiest way is to rewrite your code to use Late Binding and IOrganizationService using only fields that you really need to update like following:

    var currentAccount = new Entity("account", <account guid here>);

    currentAccount["tma_status"] = new OptionSetValue(latestProjectStatus);

    service.Update(currentAccount);

  • Son Dang Profile Picture
    42 on at

    Hi Andrii Butenko,

    I had resolved that problem.

    Thanks a lot,

    Son Dang

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans