ms crm 2011 Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/ms-crm-2011/ Microsoft Dynamics CRM . Microsoft Power Platform Mon, 18 Dec 2017 10:29:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 ms crm 2011 Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/ms-crm-2011/ 32 32 176351444 How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 http://microsoftdynamics.in/2017/12/18/how-to-create-dynamic-optionset-in-ms-dynamics-crm-2011-2013-dynamics365/ Mon, 18 Dec 2017 10:29:00 +0000 http://microsoftdynamics.in/2017/12/18/how-to-create-dynamic-optionset-in-ms-dynamics-crm-2011-2013-dynamics365/ How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 This code will help you……………… function dynamicoptionset() { //get value in no in variable     var totaldivision = Xrm.Page.getAttribute(“fieldname” ).getValue();     if (totaldivision == null || totaldivision == “” )         return;     else {         var optionsetControl = Xrm.Page.ui.controls.get( “new_division” );         var options = optionsetControl.getAttribute().getOptions();         optionsetControl.clearOptions();         for ( var i = 0; i < totaldivision; i++) {             optionsetControl.addOption(options[i]);         }    ...

The post How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 appeared first on Microsoft Dynamics 365 Blog.

]]>
How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013

This code will help you………………
function dynamicoptionset() {

//get value in no in variable
    var totaldivision = Xrm.Page.getAttribute(“fieldname” ).getValue();
    if (totaldivision == null || totaldivision == “” )
        return;
    else {
        var optionsetControl = Xrm.Page.ui.controls.get( “new_division” );
        var options = optionsetControl.getAttribute().getOptions();

        optionsetControl.clearOptions();
        for ( var i = 0; i < totaldivision; i++) {

            optionsetControl.addOption(options[i]);
        }
    }
}


SOURCE : mscrm.com

The post How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365 appeared first on Microsoft Dynamics 365 Blog.

]]>
2771
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
Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) http://microsoftdynamics.in/2015/02/25/activate-deactivate-a-record-using-c-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-using-setstaterequest/ Wed, 25 Feb 2015 12:29:00 +0000 http://microsoftdynamics.in/2015/02/25/activate-deactivate-a-record-using-c-in-ms-crm-2011-ms-crm-2013-ms-crm-2015-using-setstaterequest/ hey , as we offensively get requirement to activate and reactivate a record then we start using update event , but there is a very simple method to do so , by using SetStateRequest : it require an assembly ” microsoft.crm.sdk.proxy.dll ” and using ” using Microsoft.Crm.Sdk.Messages;” . Code will be : SetStateRequest req = new SetStateRequest(); //the...

The post Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) appeared first on Microsoft Dynamics 365 Blog.

]]>

hey , as we offensively get requirement to activate and reactivate a record then we start using update event , but there is a very simple method to do so , by using SetStateRequest : it require an assembly ” microsoft.crm.sdk.proxy.dll ” and using ” using Microsoft.Crm.Sdk.Messages;” .
Code will be :
   SetStateRequest req = new SetStateRequest();
//the entity you want to change the state of
req.EntityMoniker = new EntityReference("new_abc", recordId);
//what should the new state be
req.State = new OptionSetValue(1);
//Pick an option from the status reason picklist to specify reason for state change
req.Status = new OptionSetValue(2);
SetStateResponse resp = (SetStateResponse)service.Execute(req);

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

The post Activate / Deactivate a record using c# in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 ( using SetStateRequest ) appeared first on Microsoft Dynamics 365 Blog.

]]>
2799
Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 http://microsoftdynamics.in/2015/02/25/fields-that-are-not-valid-were-specified-for-the-entity-importing-solution-error-mscrm-2011-mscrm-2013-mscrm-2015/ Wed, 25 Feb 2015 12:12:00 +0000 http://microsoftdynamics.in/2015/02/25/fields-that-are-not-valid-were-specified-for-the-entity-importing-solution-error-mscrm-2011-mscrm-2013-mscrm-2015/ Hey , I was importing a solution today from an other Organization and got a Error new to me :  Fields that are not valid were specified for the entity , as there was no description i was little confused , but after few R&D came up with perfect resolution of the error . Reason ...

The post Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Hey , I was importing a solution today from an other Organization and got a Error new to me :  Fields that are not valid were specified for the entity , as there was no description i was little confused , but after few R&D came up with perfect resolution of the error .

Reason 

  • Organization “A” conatined attribute ‘new_mscrm’ that was of type “single line” ,Later  We changed that the field  to be an currency Type.
  • But in Organization “B” was containg same field ‘new_mscrm’ of type “Single line”.
  • When we tried to import back the new solution to test environment we got this Import failure message as the solution we were importing was having a field ‘new_mscrm’ of type Currency

Solution

  • Just delete the field in the Organization in which you are importing the solution and reimport the same solution to it
Hope this helped you Thanks

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

The post Fields that are not valid were specified for the entity – Importing Solution Error mscrm 2011 , mscrm 2013 , mscrm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2800
Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) http://microsoftdynamics.in/2015/02/20/set-field-read-only-using-javascript-in-mscrm-lock-field-in-ms-crm/ Fri, 20 Feb 2015 10:19:00 +0000 http://microsoftdynamics.in/2015/02/20/set-field-read-only-using-javascript-in-mscrm-lock-field-in-ms-crm/ Hey Below is the Code To Set a Attribute / field on form Read only (Lock) using JavaScript in MS CRM . // Get Control of entity Xrm.Page.ui.controls.get(“new_companyreference”); // Now set the property to lock the field ToBeReadOnlyControl.setDisabled(true); Note : Xrm.Page.ui.controls.get(“new_companyreference”); by this we get full UI controls of the attribute / field by which we...

The post Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>

Hey Below is the Code To Set a Attribute / field on form Read only (Lock) using JavaScript in MS CRM .
// Get Control of entity
Xrm.Page.ui.controls.get(“new_companyreference”);
// Now set the property to lock the field

ToBeReadOnlyControl.setDisabled(true);
Note : Xrm.Page.ui.controls.get(“new_companyreference”); by this we get full UI controls of the attribute / field by which we can set or get any ui property of that field .

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

The post Set Field Read Only Using JavaScript In MSCRM ( Lock Field in MS CRM ) appeared first on Microsoft Dynamics 365 Blog.

]]>
2801
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
Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 http://microsoftdynamics.in/2015/01/02/get-current-record-id-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-and-ms-crm-2015/ Fri, 02 Jan 2015 10:56:00 +0000 http://microsoftdynamics.in/2015/01/02/get-current-record-id-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-and-ms-crm-2015/ Get Record ID of an entity using javascript inn microsoft dynamics CRM . function Recordid() {     debugger;    var recordID = Xrm.Page.data.entity.getId();    var entityName = “new_entityname” ;    var urlcreation = “http://organizationame/main.aspx?etn=” +entityName+ “&pagetype=entityrecord&id=” + recordID + “#127104932” ; } SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Get Record ID of an entity using javascript inn microsoft dynamics CRM .

function Recordid() {
    debugger;
   var recordID = Xrm.Page.data.entity.getId();
   var entityName = “new_entityname” ;
   var urlcreation = “http://organizationame/main.aspx?
etn=” +entityName+ “&pagetype=entityrecord&id=” + recordID + “#127104932” ;
}

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

The post Get Current Record Id of an entity using javascript in ms crm 2011 , ms crm 2013 and ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2806
Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 http://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ http://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/#comments Fri, 02 Jan 2015 10:45:00 +0000 http://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Get Form name of an entity using javascript in microsoft dynamics crm ,This help in getting saved record form name from multipal forms ( if you want to show it in reports etc). function formname() {     debugger;     var name = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();     alert(name); } SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
Get Form name of an entity using javascript in microsoft dynamics crm ,This help in getting saved record form name from multipal forms ( if you want to show it in reports etc).

function formname() {
    debugger;
    var name = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();

    alert(name);
}



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

The post Get Form Name of an Entity using JavaScript in MS CRM 2011 , MS CRM 2013 , MS CRM 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
http://microsoftdynamics.in/2015/01/02/get-form-name-of-an-entity-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/feed/ 2 2807
Get all the Teams of User belong to using JavaScript (xml ) in ms crm 2011 , ms crm 2013 , ms crm 2015 http://microsoftdynamics.in/2014/12/30/get-all-the-teams-of-user-belong-to-using-javascript-xml-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Tue, 30 Dec 2014 09:36:00 +0000 http://microsoftdynamics.in/2014/12/30/get-all-the-teams-of-user-belong-to-using-javascript-xml-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Get all the Teams User belongs to. var xml = "" + "<?xml version="1.0" encoding="utf-8"?>" + "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" + GenerateAuthenticationHeader() + " <soap:Body>" + " <RetrieveMultiple xmlns="http://schemas.microsoft.com/crm/2007/WebServices">" + " <query xmlns:q1="http://schemas.microsoft.com/crm/2006/Query" xsi:type="q1:QueryExpression">" + " <q1:EntityName>team</q1:EntityName>" + " <q1:ColumnSet xsi:type="q1:ColumnSet">" + " <q1:Attributes>" + " <q1:Attribute>name</q1:Attribute>" + " </q1:Attributes>" + " </q1:ColumnSet>" + "...

The post Get all the Teams of User belong to using JavaScript (xml ) in ms crm 2011 , ms crm 2013 , ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>

Get all the Teams User belongs to.


var xml = "" +
"<?xml version="1.0" encoding="utf-8"?>" +
"<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" +
GenerateAuthenticationHeader() +
" <soap:Body>" +
" <RetrieveMultiple xmlns="http://schemas.microsoft.com/crm/2007/WebServices">" +
" <query xmlns:q1="http://schemas.microsoft.com/crm/2006/Query" xsi:type="q1:QueryExpression">" +
" <q1:EntityName>team</q1:EntityName>" +
" <q1:ColumnSet xsi:type="q1:ColumnSet">" +
" <q1:Attributes>" +
" <q1:Attribute>name</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:LinkEntities>" +
" <q1:LinkEntity>" +
" <q1:LinkFromAttributeName>teamid</q1:LinkFromAttributeName>" +
" <q1:LinkFromEntityName>team</q1:LinkFromEntityName>" +
" <q1:LinkToEntityName>teammembership</q1:LinkToEntityName>" +
" <q1:LinkToAttributeName>teamid</q1:LinkToAttributeName>" +
" <q1:JoinOperator>Inner</q1:JoinOperator>" +
" <q1:LinkCriteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>systemuserid</q1:AttributeName>" +
" <q1:Operator>EqualUserId</q1:Operator>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:LinkCriteria>" +
" </q1:LinkEntity>" +
" </q1:LinkEntities>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>";

var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
//alert(resultXml.xml);

// Save all entity nodes in an array.
var entityNodes = resultXml.selectNodes("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");

var teamnames = new Array();
var teamids = new Array();

for (var i = 0; i < entityNodes.length; i++) {

var entityNode = entityNodes[i];
var teamidNode = entityNode.selectSingleNode("q1:teamid");
var teamNode = entityNode.selectSingleNode("q1:name");
var teamid = (teamidNode == null) ? null : teamidNode.text;
var team = (teamNode == null) ? null : teamNode.text;

teamnames[i] = team;
teamids[i] = teamid;
}


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

The post Get all the Teams of User belong to using JavaScript (xml ) in ms crm 2011 , ms crm 2013 , ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2808
Get the CRM Organization URL using javascript in ms crm 2011 , ms crm 2013 , ms crm 2015 http://microsoftdynamics.in/2014/12/30/get-the-crm-organization-url-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Tue, 30 Dec 2014 09:34:00 +0000 http://microsoftdynamics.in/2014/12/30/get-the-crm-organization-url-using-javascript-in-ms-crm-2011-ms-crm-2013-ms-crm-2015/ Retrieve the CRM Organization URL with respect to the current domain name. For example, if you are browsing the CRM instance with IP, then the return value would be like this: http(s)://<IP>/<OrgName>If you are browsing with domain name, it would be like this: http(s)://<DomainName>/<OrgName>  function GetServerUrlRegExp(location) { var urlReg = new RegExp(/http[s]?://[0-9.:]+/[^/]+/); var ServerUrl = Xrm.Page.context.getServerUrl();...

The post Get the CRM Organization URL using javascript in ms crm 2011 , ms crm 2013 , ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>

Retrieve the CRM Organization URL with respect to the current domain name. For example, if you are browsing the CRM instance with IP, then the return value would be like this: http(s)://<IP>/<OrgName>If you are browsing with domain name, it would be like this: http(s)://<DomainName>/<OrgName> 



function GetServerUrlRegExp(location) {
var urlReg = new RegExp(/http[s]?://[0-9.:]+/[^/]+/);
var ServerUrl = Xrm.Page.context.getServerUrl();
if (window.location.href.match(urlReg) != null) {
ServerUrl = window.location.href.match(urlReg).toString();
}
if (ServerUrl.match(//$/)) {
ServerUrl = ServerUrl.substring(0, ServerUrl.length - 1);
}
return ServerUrl;
}


SOURCE : JUST2CODE.IN

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

The post Get the CRM Organization URL using javascript in ms crm 2011 , ms crm 2013 , ms crm 2015 appeared first on Microsoft Dynamics 365 Blog.

]]>
2809