Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Custom Button on form unreliable on phone browser

Posted on by 10

Hi. I have added a custom button on a form, when this button is clicked on a quick create form opens up. This works fine on the Desktop version of Dynamics however when users use this button on their phone the button sometimes works and sometimes don't. I have tested it my self and it seems like upon refresh of the page the button sometimes stops working, as in the button does nothing and the quick create form don't open up. This is NOT the Dynamics app for phones, but the normal web browser on the phone. 

This was tested in Safari (latest version) using Iphone. And on Google browser on phone. 

This is the button in question: 

pastedimage1679560556191v2.png

Any suggestions on how to get the button to be more reliable?

  • Suggested answer
    XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: Custom Button on form unreliable on phone browser

    I made a reproduction and it works on Safary on Iphone.

    You can try:

    1. Make sure that the checkbox "Restrict cross frame scripting, where supported" box is not checked the web-resource control.

    2. Use a relative path to the JS file to use cache. See https://learn.microsoft.com/en-US/power-apps/maker/data-platform/powerapps-checker/rules/web/use-cached-webresource
    Replace in script tag: /WebResources/evry_showcompliance by evry_showcompliance

    3. Try browsing with Safari in private mode to make sure it's not a cache issue. Try disabling the pop-up blocker.

    4. Make a minimal test in your JS file
    You can try this code which opens a quick create form for a contact:

    function compBtn() {
        parent.Xrm.Navigation.openForm(
        		{
        			entityName: "contact",
        			useQuickCreateForm: true
        		}
        	);
    }

    5. Embedded the script in the HTML web-resource.

     

  • MA_Dynamics Profile Picture
    MA_Dynamics 10 on at
    RE: Custom Button on form unreliable on phone browser

    It seems like turning on "enable for mobile" did make the button somewhat more reliable

    pastedimage1679644183131v2.png

    however here is the source code for the HTML file:

    <!DOCTYPE html>
    <htmllang = "en"xmlns = "">http://www.w3.org/1999/xhtml">
       <head>
          <metacharset = "utf-8"/>
          <title></title>
             <script type="text/javascript" src="/WebResources/evry_showcompliance"></script>
       </head>
       
       <body>
     <button onclick="compBtn()">Ny Compliance</button>

       </body>

    </html>

  • Eiken Profile Picture
    Eiken on at
    RE: Custom Button on form unreliable on phone browser

    Hi,

    Would you please share your web resource about this button.

    Did you try to use it in another browser?

  • XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: Custom Button on form unreliable on phone browser

    Hello, can you share the associated source code ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans