Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Webresource button at top of form

Posted on by Microsoft Employee

Hi,

How can we add a html web resource button at the top of a form besides the standard buttons (new,save etc). I know how a button can be added there by ribbon workbench. I want to know how this can be done at the top by a webresource, Thanks in advance

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Webresource button at top of form

    Hi Bachchan,

    if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Webresource button at top of form

    you can create custom buttons to open your Custom html page upon button click event.

    Please add call the below JS fuction to your button.

    function OpenMyHtml() {  

     window.open("yourorg.crm5.dynamics.com/.../Mycustomhtml.html");

    }

    Hope this helps

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Webresource button at top of form

    Hi Bachchan,

    please note the following method is highly UNSUPPORTED and is based on 365 ribbon.

    You can reach your goal without webresource, simply adding javascript to form.

    Proceed as follows:

    1) Include jquery library in entity form (first item)

    2) Include a js file library with the OnLoad method

    3) Insert this code into OnLoad method:

    var intervalcount = 0;
    var interval = setInterval(function(){
    	
    	var myid = 'account|NoRelationship|Form|MyNewButton'; // <-- new button id
    	var findel = window.top.document.getElementById(myid); // find new button
    	if(findel != null) // return if found
    		return;
    	
    // get source button var el = window.top.document.getElementById('account|NoRelationship|Form|Original.Button.Id'); var origbutton = $(el); var newbutton = origbutton.clone(myid); newbutton.attr('id', myid); newbutton.attr('title','My Button'); newbutton.attr('command',''); newbutton.insertAfter(origbutton); newbutton.on('click',function(){ alert("Hello!");}); // <-- put here your method newbutton.find('.ms-crm-CommandBar-Menu').text('My Button'); newbutton.find('.ms-crm-CommandBar-Menu').attr('command',''); if (intervalcount > 10) { clearInterval(interval); } }, 1000);


    Please note:

    1) setInterval is required because without button disappears after been added

    2) after ten call, setinterval will be nulled

    3) Hover effect doesnt works (probably is added runtime by ms code)

    Please let me know.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Webresource button at top of form

    You can only add buttons to the Command Bar by customizing the Ribbon Xml, which can be done easily by using Ribbon Workbench. You cannot add HTML Web Resources to the Command Bar.

    You can have the buttons that you create call custom JavaScript Web Resources that will display contents from HTML Web Resources if that helps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans