Customize Dynamics 365 (four): Form scripts for phones and tablets

Source: Internet
Author: User

Scripts written for forms used in WEB applications should also apply to Dynamics 365 for phones and tablets, but there are some differences. In general, methods that are not valid for mobile applications do not return errors, but they do not return any values. Developers can use the following conditional statements to divide code that will not work in a mobile application:

Javascript
if (Xrm.Page.context.client.getClient () = "Mobile") {    //ADD code that should not run in CRM for phones and tablets he Te

You can also use the Getformfactor API to set the code to run only on the phone or only on a tablet, using a statement similar to the following:

Javascript
if (Xrm.Page.context.client.getClient () = = "Mobile" && Xrm.Page.context.client.getFormFactor () = = 3) {//ADD Code that should only run in CRM for phones here}

The following list shows the effects of using a script in a mobile application. For more detailed information, see the developer documentation in the MSDN: Client programming reference.

    • Any other code that uses Window.alert, window.confirm, window.prompt, or prevents code from executing while waiting for a user response will not run as expected, or an error will be displayed. You should not use these methods in scripts for mobile applications.

    • Because the tabs that are displayed in Dynamics 365 for phones and tablets cannot be expanded or collapsed, the code that tries to expand or collapse them will not work, and the code configured for event handlers that use these events will not execute.

    • The WEB resource or iFrame element in the dashboard will not appear in the mobile application. The methods that interact with them do not run, and code configured for event handlers that use these methods for the events that are invoked will not run when the items are loaded. If you are interested in trying to use the preview feature for displaying Web resources or iFrame elements in Dynamics 365 for tablets, see Preview features: IFrame and Web resource support for CRM for tablets

    • Because Dynamics 365 for phones and tablets does not provide the ability for users to switch between different forms, the method of implementing this functionality in a WEB application will be ineffective.

    • Any methods used to display or navigate to related entities in the WEB application will be invalid.

    • Methods that will refresh the command bar, get viewport dimensions, or close the form window will not work.

Reference Address: http://www.cnblogs.com/Earson/p/dynamicsmobileformjavascript.html

Customize Dynamics 365 (four): Form scripts for phones and tablets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.