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 :
Customer experience | Sales, Customer Insights,...
Unanswered

How to open webresource in Dynamics 365 for Mobile?

(0) ShareShare
ReportReport
Posted on by 10

Hi, everyone.

We have several custom buttons which open custom html webresources.

They work properly in web. But now we need to configure Dynamics 365 for Mobile application.

When im using the latest  function like this:  Xrm.Navigation.openWebResource("mysource", "windows options"), it doesn't have any actions.

Is the function be deprecated for mobile?

I have the same question (0)
  • cloflyMao Profile Picture
    25,210 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Luis,

    Could you share me your CRM version and more details if possible?

    I tested Xrm.Navigation.openWebResource in D365 online:

    I add the function on a custom ribbon button, and I'll be navigated to a full page to web resource after I click the button.(iOS)

    Have you enable the option for mobile?

    pastedimage1576486806888v1.png

    Also, try to:

    1. add an alert before openWebResource to test whether you whole function executes in mobile app,

    2. sign out then sign in again to test.

    Regards,

    Clofly

  • Luis Yang Profile Picture
    10 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Clofly,

    Thanks for help!

    CRM online version:  1710 (9.1.0.11134) online

    Mobile APP version:  13.19122.5

    I enabled option for mobile already.

    And I tried to add alert function before "Xrm.Navigation.openWebResource".

    It works fine, but system did't navigate to the web resource.

    Any ideas?

    Luis

  • cloflyMao Profile Picture
    25,210 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Luis,

    Try my code below:

    function openWebResourceFunc() {
       var client = Xrm.Utility.getGlobalContext().client.getClient();
       if (client === 'Mobile') {
         try {
           var confirmStrings = { text: "You're in "   client   " client.", title: "Notice" };
           var confirmOptions = { height: 150, width: 250 };
           Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
             function(success) {
               if (success.confirmed) {
                 var windowOptions = { openInNewWindow: true, height: 400, width: 400 }
                 Xrm.Navigation.openWebResource("cr1e3_custombutton", windowOptions);
                 // Try deprecated api if above not works
                 // Xrm.Utility.openWebResource("webresource name"); 
                 console.log("Dialog closed using OK button.");
               } else {
                 console.log("Dialog closed using Cancel button or X.");
               }
             });
         } catch (err) {
           openAlert("Oh..", "An error occured: "   err, "Ok");
         }
       } else {
         openAlert("Hi", "The function only works on mobile client", "Close");
       }
     }
    
     function openAlert(titleContent, textContent, buttonContent) {
       var alertStrings = { confirmButtonLabel: buttonContent, text: textContent, title: titleContent };
       var alertOptions = { height: 150, width: 250 };
       Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
         function success(result) {
           console.log("Alert dialog closed");
         },
         function(error) {
           console.log(error.message);
         }
       );
     }

    Have you tested that whether other Xrm apis could work in mobile app?

    Regards,

    Clofly

  • Luis Yang Profile Picture
    10 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Clofly,

    I tried your code like this: 

    function openWebResourceFunc() {
       var client = Xrm.Utility.getGlobalContext().client.getClient();
       if (client === 'Mobile') {
         try {
           var confirmStrings = { text: "You're in "   client   " client.", title: "Notice" };
           var confirmOptions = { height: 150, width: 250 };
           Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
             function(success) {
               if (success.confirmed) {
                 var windowOptions = { openInNewWindow: true, height: 400, width: 400 }
                 
                 //Add
                 alert('Ready to open webresource');
                 
                 Xrm.Navigation.openWebResource("cr1e3_custombutton", windowOptions);
                 // Try deprecated api if above not works
                 // Xrm.Utility.openWebResource("webresource name"); 
                 console.log("Dialog closed using OK button.");
               } else {
                 console.log("Dialog closed using Cancel button or X.");
               }
             });
         } catch (err) {
           openAlert("Oh..", "An error occured: "   err, "Ok");
         }
       } else {
         openAlert("Hi", "The function only works on mobile client", "Close");
       }
     }
    
     function openAlert(titleContent, textContent, buttonContent) {
       var alertStrings = { confirmButtonLabel: buttonContent, text: textContent, title: titleContent };
       var alertOptions = { height: 150, width: 250 };
       Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
         function success(result) {
           console.log("Alert dialog closed");
         },
         function(error) {
           console.log(error.message);
         }
       );
     }

    And I got the following message:

    5504.AA.png

    After click OK button, system didn't have any action, and back to list.

    Others api works fine, but Xrm.Navigation.openWebResource has issue.

    The function can be execute 3 days ago, but now it doesn't work. 

    Luis

  • cloflyMao Profile Picture
    25,210 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Luis,

    I've tried again, but sorry for that I didn't find any potential reason.

    You could try change app version if your phone is Android.(or any available version update if iOS)

    Because you said that the function could work previously,

    if above step still not works, 

    please open a support ticket for help:

    https://admin.dynamics.com/?referer=mbssupport

    Regards,

    Clofly

  • Suxsem Profile Picture
    10 on at
    RE: How to open webresource in Dynamics 365 for Mobile?

    Hi Luis,

    did you find a solution to the issue?

    I'm still facing the same...

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 149

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 132

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 123 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans