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)

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

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