cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ScottAGrimes
New Member

Error Trying to Close D365 CRM Opportunity Using Power Automate

I'm trying to use Power Automate to close D365 CRM opportunities that meet a specific condition, but when I get to the step that closes the opportunity, I get an error - 0x80040216 - An unexpected error has occurred. Status Code 400. I'm using the Microsoft Dataverse Connector - Update a Row with a table name of Opportunity Close Activities. Below is a screen shot of the step that is failing. Does anyone have any idea what my problem may be? I've researched and tried different things until I'm blue in the face. I would appreciate any help. Thanks.

 

ScottAGrimes_0-1620415199642.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Actually, I got a suggestion in the CRM User's Group that I used before I saw your reply. Instead of using the Microsoft Dataverse - Update A Row with the table Opportunity Close Activities, I was advised to use the Microsoft Dataverse - Add A New Row with the table Opportunity Close Activities. It seems counterintuitive that you would add a row when trying to close the opportunity, but that worked perfectly. One word of caution for anyone using this solution, when identifying the opportunity to close, be sure to use the Odata Id, not just the opportunity id.

View solution in original post

5 REPLIES 5
ChrisPiasecki
Super User
Super User

Hi @ScottAGrimes,

 

You can leverage the out of box WinOpportunity unbound action in Dynamics 365. The Dataverse connector has a Perform an Unbound Action step you can add and pick from a list of available actions in the environment.

 

Note there is some known complexities/challenges when working with actions that have an entity reference parameter type. This requires you to manually set the Json object, in this case is the related Opportunity that you want to close. Hopefully MS addresses this in the near future to make bound/unbound actions easier to work with in the Power Automate designer. 

 

This blog post describes this complexity in depth and provides examples of how to run some of the actions (I asked the author to provide one for WinOpportunity specifically earlier, so you should be able to get yours working).

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Thank you Chris for your help!

Hi @ScottAGrimes,

 

Did that end up working for you? If so, please mark the reply as a solution so that others with a similar problem in the future can find this easier. 

Actually, I got a suggestion in the CRM User's Group that I used before I saw your reply. Instead of using the Microsoft Dataverse - Update A Row with the table Opportunity Close Activities, I was advised to use the Microsoft Dataverse - Add A New Row with the table Opportunity Close Activities. It seems counterintuitive that you would add a row when trying to close the opportunity, but that worked perfectly. One word of caution for anyone using this solution, when identifying the opportunity to close, be sure to use the Odata Id, not just the opportunity id.

View solution in original post

Hi @ScottAGrimes,

 

Note that the WinOpportunity action does those things you mention behind the scenes and replicates the same behaviour as clicking the close as Won button on the user interface. There is an equivalent action for LoseOpportunity as well. I would recommend using the out of box actions whenever possible as it has the least chance for unexpected side behavior to occur.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (37,290)