Mention height and width in Percentage instead of Pixels – Modal Popups in Dynamics 365 CE – NavigateTo

Hi Everyone,

Today a bug was created by the user saying the popup window is too small and we were using below code to show the HTML Webresource as a popup.

var pageInput = { pageType: "webresource", webresourceName: "WebResourceName" };
        var navigationOptions = {
            target: 2,
            width: 400,
            height: 300,
            position: 1
        };
        Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
            function success() {
                // Handle dialog closed
            },
            function error() {
                // Handle errors
            }
        );

When we have checked the code was working fine and able to see the window normally. After some checks with the users came to know that User has 19 inches monitor and that has opened doors to fix the issue. We all know that we have to use percentage instead of pixels for height and width and here is the way to use the same in NavigationOptions of NavigateTo function.

Here is the modified code of the same.

var pageInput = { pageType: "webresource", webresourceName: "WebResourceName" };
        var navigationOptions = {
            target: 2,
            //width: 400,
            //height: 300,
            width: { value: 90, unit: "%" },
            height: { value: 90, unit: "%" },
            position: 1
        };
        Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
            function success() {
                // Handle dialog closed
            },
            function error() {
                // Handle errors
            }
        );

Hope this helps.


Happy 365’ing
Gopinath

Out of the box API to get Logged In user’s security role names in Dynamics 365 is finally there. Is the long wait finally over?

Interesting. Waiting for the fix on getting Teams Security Roles names so that we can start using.

All about Dynamics 365, PowerApps, Power Platform and Power Apps portals by Debajit Dutta

Checking for logged in user’s security role is a requirement I haven’t missed in any of my implementations so far. From enterprise implementations to projects spanning couple of months, this requirement I had everywhere. And as much crazy it may sound, until recently there was no way to get the security role names directly using client API. Even the unified interface introduced which unfortunately had the same perennial problem – we shall get a the GUID of the roles user is having and then we have to fire a query to the server side to get the role names.

Thankfully Microsoft have slipped in an update to get the role names. Since this one came without much publicity, it didn’t get the media attention it deserved. Microsoft have deprecated – s and instead suggested to use . Use the function to take the output as array.

image

As seen from the…

View original post 169 more words