Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Workflow Seems to Fail when Driven by Import

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I want to reassign ownership on a block of Accounts. I have parental relationships setup from the Account Entity to all the normal downstream entities such that reassignment will cascade down to the other entities for the records associated with the Account. I'm establishing the blocks of Accounts by querying SQL data which results includes the AccountId and the UserId of the User I want to have new owership. To facilitate this through CRM I have created a new Entity called AccountReassignment and it contains the AccountId as a lookup field to the Account Entity and the NewOwnerId which is a lookup field to the User Entity. 

I have a workflow setup which activates on Create Record for the new entity (AccountReassignment). Upon record creation the first step is to do an Assign of the new OwnerId to the Account Entity. See screen shots of this workflow setup.

It then take my SQL results (AccountId and NewOwnerId), save them to a tab delimited file, and import them to the AccountReassignment Entity. I'm doing these in various batch sizes (1000, 10000, 15). I know this process works for most of what I am trying to process although success seems intermittent. I have found lately if I import 900 only 50 will actually reassign. One instance to try to isolate I processed 15 and 1 reassigned. 

Can anyone help? This seems straight forward and I believe in one article I read creating an intermediate entity with an associated create record workflow is a handy way to do mass updates via the import process.

Do I need to somehow slow the workflow down (odd as that seems) by using a wait condition in some fashion? I understand ownership reassignment at the Account level with a full cascade can be a demanding update operation depending on the size of the Account. Rapid firing such reassignment update tasks by using an import could be something that could cause such a problem.

Appreciate any help !Account-Reassignment-Workflow-Setup.JPG 

*This post is locked for comments

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Workflow Seems to Fail when Driven by Import

    Hi Mark,

      not sure what would be the best way to delete.. 

      You can try this:

    https://mscrmonline.wordpress.com/2013/07/12/how-to-bulk-delete-microsoft-crm-workflow-jobs/

    As for whether they are really waiting - I don't think so (there is an error, so, essentially, they are just stuck there not taking the resources)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow Seems to Fail when Driven by Import

    Alex, thanks to your suggestion and removing the assign's cascade all for the SalesOrder Entity from the Account Entity the workflow on the custom reassignment entity worked and performed the reassignment.

    Now I'm just curious about the remaining "waiting" items in the workflow's Process Sessions screen. Are they really still waiting or does this do double duty as an error log and a waiting item list?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow Seems to Fail when Driven by Import

    Thanks Alex. I looked at what you suggested. There are many errors and the they look like the Workflow for those is "Waiting". The messaging under "Detail" is pretty cryptic but it seems a third party plugin (Scribe CRM to Great Plains Integration) is causing an unhandled exception while trying to update the SalesOrder Entity. Perhaps I will try to remove the parental relationship for Sales Order and set Cascade None for reassignment for the Sales Order Entity. Perhaps this will isolate where the error is occurring. It would not be a big deal if the Sales Order Entity ownership was not reassigned. Is there a way I can purge all the items in the error section that appear to "waiting" or are they not really "waiting" and queued in the CRM Service?

    I will repost my results.

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Workflow Seems to Fail when Driven by Import

    Hi,

     check if you see any errors in the workflow sessions (open that workflow in the designer, you'll have "Workflow sessions" link on the left side).

     I am wondering if, while importing those records, you get user lookup field assigned correctly (maybe it just stays empty for at least some of the records because of lookup errors)

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