web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error Trying to Close ...
Power Automate
Unanswered

Error Trying to Close D365 CRM Opportunity Using Power Automate

(0) ShareShare
ReportReport
Posted on by

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

 

 

Categories:
I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Thank you Chris for your help!

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

     

    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. 

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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.

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

     

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard