Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 2016 On Premise: SLA is throwing an error back to an Async Workflow

Posted on by 255

I have an Async workflow which if triggered when the Case Status changes.  The idea is that if the Case Status is "Awaiting Customer" the workflow will wait until 1 day after the value in a Case date field before changing the Case Status back to "Pending".

The date field has no time so the workflow always executes at midnight but the Case Status change step returns an error:

Plugin Trace:

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SetState]
[SetStateStep9: Update case to outstanding (will start SLA again)]

[Microsoft.Crm.Service.ObjectModel: Microsoft.Crm.Service.ObjectModel.CasePostUpdatePlugin]
[4b723f64-b443-422b-a269-34ad739f19ee: CasePostUpdatePlugin]
Sync workflow 'SLAs - XXX' terminated with error 'An unexpected error occurred.'


[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]
Sync workflow 'SLAs - XXX' terminated with error 'An unexpected error occurred.'


Error Message:

Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: An unexpected error occurred.

The SLA is fairly simple:

Applicable when: Case Priority = "2" or "3"; Case Type = "Enhancement".

---

The Case Status change is always within the "Active" State and the case is definitely active at execution.

Thoughts so far:

  • This is on premise, we work with UK and US users, is the midnight execution somehow a factor - maybe zero hour is a problem, this is UK hosted so we have gone 1hr forward from UTC;
  • The workflow kind of triggers itself although it waits for the minimum of 1 day (though an infinite loop might be a factor but can't see how it would be with big timescales);
  • How could the SLA be having an issue?  Although I can find the hidden workflow, I can't see that there would be an issue with as the Success Criteria is NOT met.

Anyone come across an issue like this?

*This post is locked for comments

  • Suggested answer
    Jackir Profile Picture
    Jackir 75 on at
    RE: CRM 2016 On Premise: SLA is throwing an error back to an Async Workflow

    Hi I have created same porcess flow as yours. It is working for me.  One suggestion from my end is please update the DateTime  with defualt time while setting the status as Pending (1st time), then calculate your One day wating in workflow from that Datetime field.

    Please find below steps :

    1 ) Create a SLA with two SLA Details  a) Response Time b) Resolve time.  Please make sure you have marked the SLA as Defualt if you have one SLA Only.

    2) Update the Cas entity with new Date Time attribute  which will hold the day when you have change the status as Pending.

    3) Create a OOB workflow to update the Datetime with current date and time if the Case status is "Pending"

    4) In the same workflow put a wait condition till 1 day or 23 hrs on the basis of new datetime field which is created on case entity.

    5) when the workflow will reassign the Status to ending system will automatically cancels the current SLA and start a new SLa.

    Thanks,

    Jackir

  • Verified answer
    gordonj Profile Picture
    gordonj 255 on at
    RE: CRM 2016 On Premise: SLA is throwing an error back to an Async Workflow

    It seems that having my workflow execute 4 hours later at 4am has stopped the issue.

    My suspicion is that the server is setup in some way that makes the SLA workflow think that is it triggering 1 hour earlier, therefore the previous day and this is causing an error within the internal calculations.

    I can't do much about the server settings.  It would be too risky to start changing things there right now.

    Time will tell if I have solved the issue.

  • gordonj Profile Picture
    gordonj 255 on at
    RE: CRM 2016 On Premise: SLA is throwing an error back to an Async Workflow

    I do notice that when I run my workflow manually and it succeeds that it cancels the old SLA and creates anew instance.  Not sure why that should be.  Maybe something else is at play here.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans