javascript for crm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/javascript-for-crm/ Microsoft Dynamics CRM . Microsoft Power Platform Tue, 30 Dec 2014 09:36:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 javascript for crm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/javascript-for-crm/ 32 32 176351444 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