Microsoft Dataverse - Learn how to effectively manage your opportunities by utilizing a comprehensive template designed for close opportunities as either won or lost.

Microsoft Dataverse - A Template for Close Opportunities as WON or LOST

Learn how to effectively manage your opportunities by utilizing this template designed for closing opportunities as either won or lost. By leveraging this template, you can accurately handle the close opportunities.

Use the following steps to copy and paste the below template into the COZYROC JavaScript Task/Component.

1 - Drag and Drop the COZYROC JavaScript Task into the Control Flow canvas or the COZYROC JavaScript Component into the Data Flow canvas. Select REST Web Service Request Task from the drop-down list for the option Choose a pre-built script and click on the OK button, as shown in the below screen capture:


2 - Copy the below parameterization template code:

Close Opportunity as LOST
  1. <?xml version="1.0" encoding="utf-16"?>
  2. <Parameters>
  3. <RestConnection>Dataverse</RestConnection>
  4. <Method>POST</Method>
  5. <Url>/LoseOpportunity</Url>
  6. <IsBodyFile>False</IsBodyFile>
  7. <Body>
  8. <![CDATA[{
  9.   "OpportunityClose": {
  10.     "opportunityid@odata.bind": "/opportunities([opportunityGuid])",
  11.     "actualrevenue": "provide actual revenue",
  12.     "description": "provide description",
  13.      "statecode": "2"
  14.   },
  15.   "Status": "4 = Cancel, 5 = Out-Sold"
  16. }
  17. ]]>
  18. </Body>
  19. </Parameters>

Close Opportunity as WON
  1. <?xml version="1.0" encoding="utf-16"?>
  2. <Parameters>
  3. <RestConnection>Dataverse</RestConnection>
  4. <Method>POST</Method>
  5. <Url>/WinOpportunity</Url>
  6. <IsBodyFile>False</IsBodyFile>
  7. <Body>
  8. <![CDATA[{
  9.   "OpportunityClose": {
  10.     "opportunityid@odata.bind": "/opportunities([opportunityGuid])",
  11.     "actualrevenue": "provide actual revenue",
  12.     "description": "provide description",
  13.      "statecode": "1"
  14.   },
  15.   "Status": "3"
  16. }
  17. ]]>
  18. </Body>
  19. </Parameters>

And then click on the Paste button in the COZYROC JavaScript Task/Component, as shown in the below screen capture:

Note: Make sure that the parameter Method is set to POST

    Book a Presales Call

     

    Are you new to COZYROC and evaluating our solutions? 
    Book a Presales Call with us now.