Hi All,
I am getting the above-mentioned error while creating an agreement under Booking setup. Can anyone please advise me what is happening here?
Log File Details:
Exception Message: Workflow must be in Published state.
ErrorCode: -2147220891
HexErrorCode: 0x80040265
ErrorDetails:
ApiExceptionSourceKey: Plugin/Microsoft.Crm.ObjectModel.WorkflowService
ApiDepthKey: 3
ApiPluginSolutionNameKey: System
ApiStepSolutionNameKey: System
ApiExceptionCategory: ClientError
ApiExceptionMesageName: ExecuteUnpublishedWorkflow
ApiExceptionHttpStatusCode: 400
OperationStatus: 0
SubErrorCode: -2146233088
Plugin:
PluginTrace: [Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]
[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]
[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]
TraceText:
[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]
[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]
[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]
[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]
Thank you very much Avishesh, this worked for me.
Hi Satya,
We had same issue - the error message is confusing in this scenario as all the workflows were active.
I followed these steps to resolve the issue.
1. Update Field Service if required
2. Navigate to Field Service app > Field Service Settings
3. In "Other tab" of the setting, set "Use enhanced background processing" to "No" - save setting record
4. Change "Use enhanced background processing" to "Yes" - save setting record.
I hope this helps.
I assume that Enhanced Background Processing is disabled? Have you checked if all agreement-related workflows are activated?
Can you explain what your custom Flow does?
Hi Alexander Heinze,
Thank you for suggesting the way to check the failed work flows. I learned a new thing. However, I haven't found any issues with the agreements work flows except a warning.
These are the errors from Cloud Flow.
{
"error": {
"code": "0x80040265",
"message": "Workflow must be in Published state.",
"@Microsoft.PowerApps.CDS.ErrorDetails.OperationStatus": "0",
"@Microsoft.PowerApps.CDS.ErrorDetails.SubErrorCode": "-2146233088",
"@Microsoft.PowerApps.CDS.ErrorDetails.Plugin.PluginTrace": "[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]\r\n\r\n\t\r\n\t[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n\t[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]\r\n\t\r\n\t\t\r\n\t\t[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]\r\n\t\t[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]\r\n\t\t\r\n\t\t\r\n\t",
"@Microsoft.PowerApps.CDS.TraceText": "\r\n[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n[f5f1291f-596a-4ee3-bce2-6b9217ec39cf: Field Service: Update (post-operation) for msdyn_agreement]\r\n\r\n\t\r\n\t[Microsoft.Dynamics.FieldService: Microsoft.Dynamics.FieldService.FieldServicePlugin]\r\n\t[218f45c1-6b36-4746-8284-944843487145: Field Service: Update (post-operation) for msdyn_agreementbookingsetup]\r\n\t\r\n\t\t\r\n\t\t[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]\r\n\t\t[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]\r\n\t\t\r\n\t\t\r\n\t\r\n",
"@Microsoft.PowerApps.CDS.InnerError.Message": "Workflow must be in Published state."
}
}
Hi Nya,
If I do deactivate and re-activate the Booking it is working fine. The issue here is I built a power automate flow to create agreements automatically.
It is throwing the same error in the flow as well.
Hi Satya,
It is recommended to deactivate the records of Booking and Invoice related to the Agreement and re-activate them back.
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya
Agreements use logic implemented via workflow or Power Automate, your error message indicates that some workflows that have not been activated. Launch the "Solution Health Hub" app and run a "Analysis job for Rule Set: Field Service". This should give you an idea what needs to be fixed.
Going forward you may consider switching from workflow to Flow. Go to FS>Settings>Other and enable "Use Enhanced Background Processing".
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,818 Super User 2024 Season 2
Martin Dráb 229,147 Most Valuable Professional
nmaenpaa 101,156