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

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(Cancel’);
    $(“#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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s