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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Ribbon Workbench question here about creating command

(0) ShareShare
ReportReport
Posted on by

I have a question about configuring a new command within the Ribbon Workbench.

I am trying to grab a URL address from within a single text box URL.

I have went through some online tutorials where it helps a user define a new command to an extermal URL, but I need to grab the url from a single text box url type field, which is located on the same entity as I am creating the button. https://ribbonworkbench.uservoice.com/knowledgebase/articles/71374-1-getting-started-with-the-ribbon-workbench#Defining_a_Button_Command

Please help, this is urgent for me!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Adam,

    You can probably use a Url action for that, but I prefer a javascript action for a case like this. In your js you could pull the value off the form using Xrm.Page.getAttribute (detailed here: msdn.microsoft.com/.../dn481592.aspx), then open that a new window from your script.

    If this helps I'd appreciate if you would mark this as Answering your question.

    Thanks,

     Aiden

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Adam,

    As long as the single text field is inside the form you can use javasccript to grab it.

    After that you pass it to the external url.

    var varMyValue = Xrm.Page.getAttribute("CRMFieldForGetting theURL").getValue() ;

    You want to call a website to redirect something like that?

    www.powerobjects.com/.../how-to-create-url-text-field-using-javascript-dynamics-crm

    thinketg.com/crm-2011-custom-direct-url-link-field-using-javascript-tutorial

  • Community Member Profile Picture
    on at

    Aileen :)

  • Community Member Profile Picture
    on at

    Aiden/Aileen so far so good, I am comfortable with the coding part.

    Here is my code, which all works very well..

    function geturlfromtxtfield() {

      try {

       var textfieldurl = Xrm.Page.getAttribute("new_mapurl").getValue();

    alert(textfieldurl);

    window.open(textfieldurl);

    }

      catch(e)

     {

      }

    }

    The problem I am facing now is successfully executing this on a newly created button within Ribbon Workbench... so stuck, please help.

    I see where I can define the command for the button and custom action type of JavaScript but I guess I'm not doing it correctly because it is not working when I click the button.

    I have loaded the web resource and account entity in with the solution because it required the webresource be present. I'm not sure of the steps in order to get this to open the web URL upon button click.

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi Adam,

    Sounds like you are very nearly there.

    Can you post your the xml you have in the Ribbon Workbench so we can take a look.

    Make sure you have linked your button to the command and also try publishing a second time since occasionally Dynamics CRM doesn't clear it's cache the first time.

    Hope this helps

  • Community Member Profile Picture
    on at

    Scott thanks for the reply, here's what I got -

    I created the button:

    newcmd.PNG

    I have also tried specifying the Command (and CommandCore) separately with the Command solution element. I have also left both blank and still didn't help:

    buttonctrl.PNG

    I then selected Commands (following a KB I found) and right clicked, selected Add New


    I created a new command:

    newcomd.PNG

    newcmd.PNG

    Then I defined the Action for the command as follows (function name is the name of my function and the Library I uploaded with the solution per the directions and I was able to search/select it):

    8032.action.PNG

    This is my first deep dive into Ribbon Workbench so I hope I answered all your questions here. Thanks and I look forward to your assistance.

  • Verified answer
    ScottDurow Profile Picture
    21 on at

    UPDATE: Images are now showing!

    Check that you have the correct function name in the Javascript command - it doesn't match the code you posted above.

    Also - can you post the xml?

    Thanks,

  • Community Member Profile Picture
    on at

    UPDATE:  I fixed the function name and BOOOOOOOM IT WORKS!!!!!!!!!! Everyone gets 'answered correctly' because this was totally a team effort! THANKS guys and gals!

  • dmoysidis Profile Picture
    on at

    Thanks for that! It worked for me as well!

    Easy but so useful!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans