dynamics-crmmicrosoft-dynamicscrm-ribbon-workbench

Redirect on click on button dynamics 365


I have been working with ribbon workbench 2016 beta and smart buttons and I realized that there is not a function to redirect on click.

What I want is when I do click on a button which create a new entity record that these action redirect me to the new entity record that it has created... This entities are, orders and delivery note. The two entities are related. The button is located in the first entity.

Do you have any idea how to do it?

This is the button

And this is the page where i want to be redirect.


Solution

  • To redirect you have to create a new js that is called by the command on the ribbon button. Get the value of the related entity and populate it in a new window.

    function Redirect()
    {
    var URL= Xrm.Page.getAttribute("relatedentityurl").getValue();  
    
    if (URL != null || URL != "")
    {
    
    window.open(URL, '_blank');
    }
    
    }