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

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics CE Tech Blog / Add a custom button on Web ...

Add a custom button on Web Page - Dynamics 365 CE Portals

gopi.royal999@gmail.com Profile Picture gopi.royal999@gmail... 430
Hi,

Today when I was working on Portals, I got a requirement to add a cancel button beside Submit button on EntityForm and user has to navigate back to EntityList when click on it.

We can quickly do this by adding some script on the WebPage. Open the required WebPage and there is a tab named as Advanced and add the below code. I have used SiteMarkers to navigate. 


$(document).ready(function () {
    $('#InsertButton').after('<button id="cancelbutton" type="button" class="btn btn-primary button" style="margin-left:10px;"><span></span>Cancel</button>');
    $("#cancelbutton").click(function () {
        window.location.href = "{{ sitemarkers['ML_CustomEntityList'].url }}";
    });

});

Make sure you add the same piece of code in all Content Pages. 

Hope this helps.

--
Happy 365'ing
Gopinath

Comments

*This post is locked for comments