using javascript in mscrm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/using-javascript-in-mscrm/ Microsoft Dynamics CRM . Microsoft Power Platform Wed, 11 Oct 2017 07:51:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 using javascript in mscrm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/using-javascript-in-mscrm/ 32 32 176351444 Method Xrm.Page.ui.formSelector does not work in tablet and mobile device. Use getClient() in Dynamics 365 , MS CRM http://microsoftdynamics.in/2017/10/11/method-xrm-page-ui-formselector-does-not-work-in-tablet-and-mobile-device-use-getclient-in-dynamics-365-ms-crm/ Wed, 11 Oct 2017 07:51:00 +0000 http://microsoftdynamics.in/2017/10/11/method-xrm-page-ui-formselector-does-not-work-in-tablet-and-mobile-device-use-getclient-in-dynamics-365-ms-crm/ Below are some of the examples that will not work in tablets when using MSCRM Xrm.Page.context.� getCurrentTheme Xrm.Page.ui� ViewPort Methods Xrm.Page.data.entity.� getDataXml Xrm.Page.ui control� Web resource and IFRAME control methods Xrm.Page.ui.� formSelector object methods Xrm.Page.ui tab.� setDisplayState Xrm.Page.ui.� navigation.items collection Xrm.Utility.� openWebResource Xrm.Page.ui.� refreshRibbon When these method are executed in Tablet or mobile device then these will return nothing and defining will return undefined. So  if...

The post Method Xrm.Page.ui.formSelector does not work in tablet and mobile device. Use getClient() in Dynamics 365 , MS CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
Below are some of the examples that will not work in tablets when using MSCRM

Xrm.Page.context. getCurrentTheme Xrm.Page.ui ViewPort Methods
Xrm.Page.data.entity. getDataXml Xrm.Page.ui control Web resource and IFRAME control methods
Xrm.Page.ui. formSelector object methods Xrm.Page.ui tab. setDisplayState
Xrm.Page.ui. navigation.items collection Xrm.Utility. openWebResource
Xrm.Page.ui. refreshRibbon

When these method are executed in Tablet or mobile device then these will return nothing and defining will return undefined.

So  if we are customization it for tablet we should distinguish the client device in JS and write code .
var isCrmForTablets = (Xrm.Page.context.client.getClient() == “Mobile”)
if (isCrmForTablets)
{
// Code for CRM for tablets only goes here,
}
else
{
// Code for web browser or CRM for Outlook only goes here.
}
// Code for any client goes here.
 
To make sure which commands will work in tablet then include a command rule for more info refer Here.

Hope it will help. thanks

SOURCE : mscrm.com

The post Method Xrm.Page.ui.formSelector does not work in tablet and mobile device. Use getClient() in Dynamics 365 , MS CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
2774
Get Form Type And Save Modes using JavaScript in mscrm 2011 , mscrm 2013 , mscrm 2015 http://microsoftdynamics.in/2015/06/10/get-form-type-and-save-modes-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ Wed, 10 Jun 2015 13:49:00 +0000 http://microsoftdynamics.in/2015/06/10/get-form-type-and-save-modes-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ getSaveMode() : Its Return a value telling what was the save event of ms crm entity record ( like is it due to deactivation of form , manual save or save and close etc) below is the full list of events . // CodeexecObj.getEventArgs().getSaveMode(); Event Mode Value Save 1 Save and Close 2 Deactivate 5...

The post Get Form Type And Save Modes using JavaScript in mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
getSaveMode() : Its Return a value telling what was the save event of ms crm entity record ( like is it due to deactivation of form , manual save or save and close etc) below is the full list of events .

// Code
execObj.getEventArgs().getSaveMode();

Event Mode Value
Save 1
Save and Close 2
Deactivate 5
Reactivate 6
Send (Email) 7
Disqualify (Lead) 15
Qualify (Lead) 16
Assign (user or team owned entities) 47
Save as Completed (Activities) 58
Save and New 59
AutoSave 70

getFormType() :  Its Return a value Telling about form type of ms crm entity record ( Update , or create etc) , below is the full list of events.


// code
Xrm.Page.ui.getFormType();

Form Type Value
Undefined 0
Create 1
Update 2
Read Only 3
Disabled 4
Quick Create 5
Bulk Edit 6
Read Optimized 11

Its very usefull when you want to restrict or allow any particular event in ms crm using javascript  .


SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Form Type And Save Modes using JavaScript in mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2796
Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 http://microsoftdynamics.in/2015/06/10/get-server-url-or-ip-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ Wed, 10 Jun 2015 12:55:00 +0000 http://microsoftdynamics.in/2015/06/10/get-server-url-or-ip-using-javascript-in-mscrm-2011-mscrm-2013-mscrm-2015/ Some time we need to get server IP  instead of Server URL Like when we need to write Odata Query in dev and frequently sift Solution from dev to production , it imp to get Ip dynamically so , you Odata don’t give error . // Simple Server Url using JavaScript var serverUrl = Xrm.Page.context.getServerUrl();...

The post Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Some time we need to get server IP  instead of Server URL Like when we need to write Odata Query in dev and frequently sift Solution from dev to production , it imp to get Ip dynamically so , you Odata don’t give error .
// Simple Server Url using JavaScript
var serverUrl = Xrm.Page.context.getServerUrl();
//Work fine for both IP And server

var serverUrl = document.location.protocol + “//” + document.location.host + “/” + Xrm.Page.context.getOrgUniqueName();

This Above code will work fine for both Server IP or Url as when we access mscrm record with only server name ( but our odata code contain ip it will throw an exception ) or if we access with IP ans our code contain server url so to prevent this we can use above code to get dynamic URL address.

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Server URL or IP using JavaScript in MSCRM 2011 , MSCRM 2013 , MSCRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2797
Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) http://microsoftdynamics.in/2015/02/19/get-field-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-field-label-using-javascript/ Thu, 19 Feb 2015 12:14:00 +0000 http://microsoftdynamics.in/2015/02/19/get-field-name-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-get-dynamically-field-label-using-javascript/ Hi all below you will find how to get field label name using JavaScript . var fieldname = executionContext.getEventSource().getName(); NOTE: Remember to pass context as perimeter while submitting function Name. SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) appeared first on Microsoft Dynamics 365 Blog.

]]>

Hi all below you will find how to get field label name using JavaScript .
 var fieldname = executionContext.getEventSource().getName();
NOTE: Remember to pass context as perimeter while submitting function Name.


SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get field Name Using JavaScript in ms crm 2011 , ms crm 2013 , ms crm 2015 ( get dynamically field Label using JavaScript) appeared first on Microsoft Dynamics 365 Blog.

]]>
2803