Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / How to reference "...
Sales forum
Answered

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

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans