The new App supports JavaScript so I wanted to test a little script with the method getFormFactor.
getFormFactor (MSDN link) is a new method introduced with CRM Online 2015 Update 1 returning a numeric value based on the current device. The possible values are:
Value | Form Factor |
---|---|
0 | Unknown |
1 | Desktop |
2 | Tablet |
3 | Phone |
The script I wrote is:
function accountOnLoad() { var factor = Xrm.Page.context.client.getFormFactor(); var message = "The Form Factor is: " + factor; Xrm.Utility.alertDialog(message); }And the result is:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizoRIdaC2KTHZ4j9qKUQWTvediVfYTmzmdc5RnrOX8i1F9Ivdy7RZBVULf_qgMw0o5dKNSPCXeUszXrrrYwLho9hTBa1-mxBOrhM7sabUILUHpEEh4vQs3H7lUPSmnmiBpoJ4sE0Z1myI/s1600/alert.jpg)
Note: the script is not called when a new record is created.
0 comments:
Post a Comment