Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

How to reference "/_script/sfa/quotes/quote.js" in Custom WebResource File?

(0) ShareShare
ReportReport
Posted on by 5

Hello,

How to reference "/_script/sfa/quotes/quote.js" in Custom WebResource File?

WHen a Quote gets created and we try to click the Create Order Button .

It hits the reference "/_script/sfa/quotes/quote.js" "AcceptQuoteOrCreateOrder" function.

Now I have a need for some Custom validations to put before hitting this Function.

I tried adding a new Command action under ribbon workbench below or above the specified command action. But it gives runtime issue as /_script/sfa/quotes/quote.js is not a valid web resource assembly. Wherein if I remove my changes and just keep the quote js reference it works.

I need to amend a custom function before this hit. Or any way I can Reference this quote,js function in my custom Web Resource and I'll get it removed from button hit instead and add on my customised function????

Thanks In Advance

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to reference "/_script/sfa/quotes/quote.js" in Custom WebResource File?

    Hi Manish Uppal,

    There is no need to add reference. After the validation, invoke the OOB function is ok.

    I'm using Dynamics 365 Online. My library name is: $webresource:Sales/_static/SFA/quotes/QuoteRibbonActions.js Function name is Sales.QuoteRibbonActions.Instance.acceptQuoteOrCreateOrder.(If you are also using Dynamics 365 Online, please check the button's command.)

    pastedimage1641451688042v2.png

    Then I create a new web resource like this:

    function createOrder(){
    	console.log("create order");
    	//do validation:
    	Sales.QuoteRibbonActions.Instance.acceptQuoteOrCreateOrder();
    }
    

    Use it in the Ribbon Workbench:

    pastedimage1641451671575v1.png

    Result:

    pastedimage1641451803669v3.png

     

    Reference:

    How to override out of the box button’s behavior in ms crm – Dynamics 365 CE/Power Platform, PowerApps, Power Automate, Azure by Vishal Grade

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans