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)

Dynamics CRM Workflow Firing Incorrectly

(0) ShareShare
ReportReport
Posted on by 765

Hey everyone,

I'd appreciate your help on this problem I'm having in Dynamics CRM 2013 On-Premise.  I've created a Custom Workflow Activity for the system that runs on the Accounts page, giving the account an 'Account Number' when the relationship type is 'Client'. My question/problem is that when I run the workflow against an account, for some reason, it fires off an unrelated workflow that is triggered on the change of the address on an Account. This doesn't make any sense as my Custom Workflow doesn't touch or modify address. Can anyone provide any sort of explanation? 

Thanks

*This post is locked for comments

I have the same question (0)
  • Mamatha Swamy Profile Picture
    5,426 on at

    One thing to check is if the custom workflow is updating any field that is listed in the 'Record fields change' of the Address related workflow. You might not be updating the address but the other workflow's trigger fields could be more than just the address. Worth checking...

  • AEdwards Profile Picture
    765 on at

    The workflow is only triggered by address fields and none of those are touched by my code; that was one of the first things I checked.

  • Mamatha Swamy Profile Picture
    5,426 on at

    Is there any other code like a plugin that is getting triggered after your custom workflow?

  • AEdwards Profile Picture
    765 on at

    Not that I've found thus far, no.

  • Mamatha Swamy Profile Picture
    5,426 on at

    Hmm., I would disable any plugins on Account and on any related entity that you might be updating in your custom workflow and check.

    You must have checked it already, if not, make sure the address workflow isn't triggered on any other conditions like status change/assign.

  • mscrmba Profile Picture
    on at

    A couple of possibilities...

    Do you have a business rule e.g. that defaults/sets the 'Country' of the address?

    Is the unrelated workflow also triggered on create / status change?  (I'm guessing you assign the Account Number when you create a brand new account record.)

  • Suggested answer
    Hugo Silva Profile Picture
    1,374 on at

    Hi AEdwards,

    Try to go to SDK Message Processing System and Deactivate the steps you think is affecting your workflow related to the entity you working on (since is account turn those off and then try again). Check if you have the same behavior, if not then you need to change your code because it could be messing around with the plugins that the CRM have by default or from other 3th party solution. 

    sdkmessage.gif

  • AEdwards Profile Picture
    765 on at

    Hey everyone,

    I did some testing and investigating and found some more info:

    A. Nothing else is triggering the workflow, it seems to just be my Custom Workflow Activity

    B. It's not just address, I changed the workflow to be triggered on (only) Account Name change, and ran my Custom Workflow, and same thing occurred.

    C. I'm not seeing the triggered workflow, nor my Custom Workflow in the SDK Message Processing System

    To summarize, it seems as though it is my Custom Workflow causing the Address Workflow to be kicked off. My Custom Workflow doesn't directly change or modify any other fields except Account Number, but it seems that the Custom Workflow does a refresh on all fields on the form, triggering other workflows.

    Is this a known issue?

    I update the fields in the code with:

    service.Update(targetRequest);

    Is there a better way?

    Thanks

  • Verified answer
    AEdwards Profile Picture
    765 on at

    I stumbled across the answer while looking through the SDK sample projects for how they update fields.

    In my code I was creating a target and then updating a field like this:

    Entity targetRequest = (Entity)((RetrieveResponse)service.Execute(request)).Entity;

    targetRequest.Attributes["accountnumber"] = newAccountNumber;

    service.Update(targetRequest);

    This, apparently, causes a refresh of all fields on the form, or something of the like; To fix this I had to create an 'update' entity as such:

    Entity updateEntity = new Entity("account");
    updateEntity.Id = context.PrimaryEntityId;

    updateEntity["accountnumber"] = newAccountNumber;
    service.Update(updateEntity);

    This secondary method does not refresh any other fields on the form, thus not firing off any workflows that may be dependent on that.

     

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans