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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Locking ability to create quote until required approvals met?

(0) ShareShare
ReportReport
Posted on by 117

Is there a way to hide the quote tab on the Opportunity form until certain criteria / stage in the business process is met? I've tried using hidetab jscript, but I'm failing. Could be because I have absolutely no idea what I'm doing. I mean, that's really the crux of it. 

Idea being - salesperson creates an opportunity. I don't want them to be able to create a quote until they've gotten the required approval sign-offs. We're able to keep them from progressing in the business process flow, but that doesn't keep them from being able to actually create a quote. 

Any suggestions? I mean, the easiest would be just to tell the sales people "hey, don't do that" but we know how well that works. 

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I would recommend to use Real-Time Workflows to block creation of quote. Here is how you can do that:

    1. Create a RealTime Workflow that will handle create of quote.

    2. Check if quote has parent opportunity and validate if required approvals were signed-off. If conditions are not met - stop the workflow with Error - that will stop the creation of quote.

  • Suggested answer
    JayBuddhdevtest Profile Picture
    275 on at

    Hi,

    You can create a flow and can leverage the Approval feature. Following are the steps that you would need to take.

    1. Goto make.powerapps.com -> Flows.

    2. Click on New -> Automated from blank.

    3. Select the trigger of When a record is created (cds). Select opportunity as an entity.

    4. Add a new step for approvals. Add appropriate details that you want to send the approval to.

    5. Save and test the flow.

    For more details on approval, you can read this blog: www.powerobjects.com/.../

    I hope this helps. Please let me know if you have any questions/concerns.

    Thanks

    Jay

  • Suggested answer
    LuHao Profile Picture
    40,892 on at

    Hi Tonya,

    I agree with Andrew.

    For real-time workflow, you can refer to this blog: http://crmkrm.blogspot.com/2018/03/microsoft-dynamics-365-workflows-real_19.html

    You could new a two option field on the opportunity to indicate whether this opportunity is approved, and then use it in the workflow condition. 

    Of course, this two option field is also automatically updated through flow (Jay's solution).

    pastedimage1594111369037v1.png

    New a real-time workflow of Quote.

    pastedimage1594112406115v2.png

    Select Scope to Organization.

    pastedimage1594112571113v4.png

    Add a step "Check Condition", Opportunity(Opportunity), the two option field, Equals, No.

    pastedimage1594112553437v3.png

    Then add a step "Stop workflow", select Canceled. Set Properties, enter the message that users will see when they create quote.

    pastedimage1594112697740v5.png

    Activate the workflow.

    In this way, when the opportunity is not approved and the user create a quote for it, he will see an error message.

    pastedimage1594112840085v6.png

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Could you please share the JS code you used to hide quote tab on opportunity to investigate the issue.

    I have added new custom field new_approved on opportunity entity  which is two option field and added below code to show/hide quote tabs.

    function HideQuoteTab(executionContext) {

    alert("Triggered");

    var _formContext=executionContext.getFormContext();

      if(_formContext.getAttribute("new_approved").getValue() == false) {

          alert("Value is NO")

      _formContext.ui.tabs.get("QUOTES").setVisible(false);

      }

      else if(_formContext.getAttribute("new_approved").getValue() == true){

      alert("Value is yes");

          _formContext.ui.tabs.get("QUOTES").setVisible(true);

      }

    }

    and it seems to be working fine. make sure you add this function on onload and onchange event.

    If found helpful, Please mark my answer verified.

  • LuHao Profile Picture
    40,892 on at

    Hi partner,

    Has the problem been solved? Any updates?

    Please click Yes under "Did this answer your question?" to close this thread.

    pastedimage1595314810164v1.png

    Thanks.  : ) 

  • DanOsgood Profile Picture
    55 on at

    In step 3 you state to select Opportunity as the entity. Shouldn't this be Quote as that is what needs to be approved?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans