Skip to main content
Dynamics 365 Community / Forums / Sales forum / Revising Opportunities...
Sales forum
Suggested answer

Revising Opportunities and Quotes that have already been Closed

editSubscribe (1) ShareShare
ReportReport
Posted on by 20
As a system admin, I'm trying to figure out the best way to do this.  Currently, the only way I have figured how to do this is to reopen the opportunity, delete the products under the quote, then delete the quote and generate a new quote, activate it and win it.  However, this also changes the quote number which is what I want to avoid.  I've tried using Online Excel and the Level Up extension, but both just produced other issues that I couldn't fix.
 
1. Is it possible to do this with out changing the current quote #?
2. If not, is there at least an easier way to change the $ amounts?
Attachments
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Revising Opportunities and Quotes that have already been Closed
    Hi,
     
    You can add a custom button on the quote form to switch from the closed state to the draft state, and this button is only visible in the closed state.
     
    The JavaScript executed by clicking the button is as follows.
    function SwitchToDraft(primaryControl) {
            var formContext = primaryControl;
     
            //Gets the GUID of the current record.
            var currentRecordId = formContext.data.entity.getId().slice(1,-1);
     
            //Updates the current record to draft status.
            window.top.Xrm.WebApi.updateRecord("quote", currentRecordId, {"statecode":0}).then(
            function success(result) {
                console.log("Current quote switched to draft status");
               
                //Refresh after successful update.
                formContext.data.refresh(true);
            },
            function (error) {
                console.log(error.message);
            }
        );
       
    }
     
    The code to set the button visibility is as follows.
    function SwitchVisibility(primaryControl){
        var formContext = primaryControl;
        // Gets the status field value
        var status = formContext.getAttribute("statecode").getValue();
       
        // If the value of the Status field is not 3, then it is not closed status and the button is hidden.
        if(status !==3){
            return false;
        }else{
            return true;
        }
    }
     
    Add this button to Ribbon Workbench.
     
    The final result is shown below.
     
    Best Regards,
    Dengliang Li
     
  • DonaW Profile Picture
    DonaW 20 on at
    Revising Opportunities and Quotes that have already been Closed
    This is awesome, thank you.  It worked great.  I know I'm asking a lot and this is probably not doable, but is there a way to do this without having to open the flow and copy the URL each time?
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Revising Opportunities and Quotes that have already been Closed
    Hi,
     
    You can update closed quotes to draft status in Power Automate Flow.
    In my test, I selected a closed quote record.
     
    The flow is shown below.
     
    In the test result the quote went back to draft status and the ID did not change.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Demystifying Copilot with Sundar Raghavan

Sundar explains how Copilot for Service is meant to function separately...

Business Process Guidance Badges and New…

The Microsoft Success by Design is the framework for implementing Dynamics 365…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,266 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,978 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans