16. Dezember 2009 18:36
17. Dezember 2009 10:36
17. Dezember 2009 12:43
17. Dezember 2009 20:25
// Ermittelt die Firmennummer und Telephone1 der übergeordneten Firma im Kontakt
if (crmForm.all.parentcustomerid.DataValue != null)
{
var myAccountId = crmForm.all.parentcustomerid.DataValue[0].id;
// Define the SOAP XML to access Microsoft Dynamics CRM Web service.
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>account</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>accountnumber</q1:Attribute>" +
" <q1:Attribute>telephone1</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>accountid</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">myAccountId</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>";
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
// Configure the XMLHttp object for the
// Microsoft CRM Web services.
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:accountnumber");
if (nodeNumber.length == 1)
{
crmForm.all.Field1.DataValue = parseFloat(nodeNumber[0].text);
}
var nodeTelephone = resultXml.selectNodes("//q1:telephone1");
if (nodeTelephone.length == 1)
{
crmForm.all.Field2.DataValue = parseFloat(nodeTelephone[0].text);
}
}
}
22. Dezember 2009 00:51
// Ermittelt die Firmennummer und Telephone1 der übergeordneten Firma im Kontakt
if (crmForm.all.customer.DataValue != null)
{
var myAccountId = crmForm.all.customer.DataValue[0].id;
// Define the SOAP XML to access Microsoft Dynamics CRM Web service.
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>contact</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>accountidname</q1:Attribute>" +
" <q1:Attribute>telephone1</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>accountid</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">myAccountId</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>";
alert(myAccountId);
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
alert(xmlHttpRequest);
// Configure the XMLHttp object for the
// Microsoft CRM Web services.
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:accountidname");
if (nodeNumber.length == 1)
{
crmForm.all.companyname.DataValue = parseFloat(nodeNumber[0].text);
}
var nodeTelephone = resultXml.selectNodes("//q1:telephone1");
if (nodeTelephone.length == 1)
{
crmForm.all.telephone.DataValue = parseFloat(nodeTelephone[0].text);
}
}
}
22. Dezember 2009 10:39
Tomily hat geschrieben:1. Woher kommt das Feld: "crmForm.all.ParentCustomerId.DataValue"
Und welchen Bezug hat das?
Tomily hat geschrieben:2. Ist diese Script so eine Art SQL Abfrage, richtig?
Tomily hat geschrieben:Aber ich glaube mir fehlt indem Feld so der richtige Einsprung. Wie gesagt, ich habe das Feld Customer, in dem ich einen "Person" eingebe. Dioes ist ein lookupfeld, und von dort aus muss er eine Abfrage auf die Contact Tabelle im SQL machen und checken in welcher Firma der Kollege ist Und dann gewünbschte Felder wie Telefonnummer, Firmenname usw. zurück geben.
23. Dezember 2009 02:34
23. Dezember 2009 09:22
tomily hat geschrieben:Gibt es im CRM keine Funktion, die auf Basis eines Feldinhaltes alle relevanten Daten anzeigt?
tut mir leid, wenn ich diese blöden Fragen stelle, aber EIGENTLICH weiß die Datenbank ja alles. Das CRM kann sie nur nicht einfach dar stellen.
tomily hat geschrieben:So, wie bekomme ich jetzt Teil 1. hin?
ebenfalls mit so einem FetchXML und diesen soaps?
Gibt es verschiedene soaps?
Wel dein Script, welches ich angepasst habe basiert ja auf: crmForm.all.customer.DataValue
Leider liefern die Soaps nix zurück.
tomily hat geschrieben:Kann man denn sowas wie nen Join bauen?
26. Dezember 2009 04:16
28. Dezember 2009 15:58
28. Dezember 2009 21:24
28. Dezember 2009 21:52
29. Dezember 2009 16:01
tomily hat geschrieben:ich habe das hier gefunden und teste das grade.
http://jamesdowney.net/blog/page/Reques ... r-Key.aspx
tomily hat geschrieben:Brauche ich denn für dieses "Client Side Scripting" eine Visual Studio developer Umgebung???
29. Dezember 2009 22:48
30. Dezember 2009 00:14
// Ermittelt die Firmennummer und Telephone1 der übergeordneten Firma im Kontakt
if (crmForm.all.customer.DataValue != null)
{
var myAccountId = crmForm.all.customer.DataValue[0].id;
// Define the SOAP XML to access Microsoft Dynamics CRM Web service.
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>contact</q1:EntityName> " +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\"> " +
" <q1:Attributes> " +
" <q1:Attribute>fullname</q1:Attribute> " +
" </q1:Attributes> " +
" </q1:ColumnSet> " +
" <q1:Distinct>false</q1:Distinct> " +
" <q1:Criteria> " +
" <q1:FilterOperator>And</q1:FilterOperator> " +
" <q1:Conditions> " +
" <q1:Condition> " +
" <q1:AttributeName>customerid</q1:AttributeName> " +
" <q1:Operator>Equal</q1:Operator> " +
" <q1:Values> " +
" <q1:Value xsi:type=\"xsd:string\">myAccountId</q1:Value>" +
" </q1:Values> " +
" </q1:Condition> " +
" </q1:Conditions> " +
" </q1:Criteria> " +
" </query> " +
" </RetrieveMultiple> " +
" </soap:Body> " +
"</soap:Envelope> ";
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
// Configure the XMLHttp object for the
// Microsoft CRM Web services.
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeFullname = resultXml.selectNodes("//q1:fullname");
if (nodeFullname.length == 1)
{
crmForm.all.emailaddress.DataValue = parseFloat(nodeFullname[0].text);
}
}
}
"<?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"><soap:Header><CrmAuthenticationToken xmlns="http://schemas.microsoft.com/crm/2007/WebServices"><AuthenticationType xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">0</AuthenticationType><CrmTicket xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes"></CrmTicket><OrganizationName xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">e-Spirit</OrganizationName><CallerId xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">00000000-0000-0000-0000-000000000000</CallerId></CrmAuthenticationToken></soap:Header> <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>contact</q1:EntityName> <q1:ColumnSet xsi:type="q1:ColumnSet"> <q1:Attributes> <q1:Attribute>fullname</q1:Attribute> </q1:Attributes> </q1:ColumnSet> <q1:Distinct>false</q1:Distinct> <q1:Criteria> <q1:FilterOperator>And</q1:FilterOperator> <q1:Conditions> <q1:Condition> <q1:AttributeName>customerid</q1:AttributeName> <q1:Operator>Equal</q1:Operator> <q1:Values> <q1:Value xsi:type="xsd:string">myAccountId</q1:Value> </q1:Values> </q1:Condition> </q1:Conditions> </q1:Criteria> </query> </RetrieveMultiple> </soap:Body> </soap:Envelope> "
4. Januar 2010 11:02
4. Januar 2010 11:07
4. Januar 2010 11:28
4. Januar 2010 19:08
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeFullname = resultXml.selectNodes("//q1:fullname");
if (nodeFullname.length == 1)
{
crmForm.all.emailaddress.DataValue = parseFloat(nodeFullname[0].text);
}
}
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var entityNodes = resultXml.selectNodes("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
for (var i = 0; i < entityNodes.length; i++)
{
var entityNode = entityNodes[i];
var fullnameNode = entityNode.selectSingleNode("q1:fullname");
var fullnameText = (fullnameNode == null) ? null : fullnameNode.text;
alert(fullnameText);
}
}
4. Januar 2010 20:07
// Ermittelt die Firmennummer und Telephone1 der übergeordneten Firma im Kontakt
if (crmForm.all.customer.DataValue != null)
{
alert(crmForm.all.customer.DataValue);
var myAccountId = crmForm.all.customer.DataValue[0].id;
// Define the SOAP XML to access Microsoft Dynamics CRM Web service.
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>contact</q1:EntityName> " +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\"> " +
" <q1:Attributes> " +
" <q1:Attribute>fullname</q1:Attribute> " +
" </q1:Attributes> " +
" </q1:ColumnSet> " +
" <q1:Distinct>false</q1:Distinct> " +
" <q1:Criteria> " +
" <q1:FilterOperator>And</q1:FilterOperator> " +
" <q1:Conditions> " +
" <q1:Condition> " +
" <q1:AttributeName>customerid</q1:AttributeName> " +
" <q1:Operator>Equal</q1:Operator> " +
" <q1:Values> " +
" <q1:Value xsi:type=\"xsd:string\">myAccountId</q1:Value>" +
" </q1:Values> " +
" </q1:Condition> " +
" </q1:Conditions> " +
" </q1:Criteria> " +
" </query> " +
" </RetrieveMultiple> " +
" </soap:Body> " +
"</soap:Envelope> ";
// Create an instance of an XMLHTTP object.
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
alert(xmlHttpRequest)
// Configure the XMLHttp object for the
// Microsoft CRM Web services.
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
// Send the XMLHttp request.
// Send the XMLHttp request.
xmlHttpRequest.send(xml);
alert(xmlHttpRequest.status);
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
alert(resultXml);
var entityNodes = resultXml.selectNodes("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
alert(entityNodes);
for (var i = 0; i < entityNodes.length; i++)
{
var entityNode = entityNodes[i];
var fullnameNode = entityNode.selectSingleNode("q1:fullname");
var fullnameText = (fullnameNode == null) ? null : fullnameNode.text;
alert(fullnameText);
}
}
}
<fetch count='10' mapping='logical'>
<entity name='contact'>
<attribute name='accountid'/>
<attribute name='gendercode'/>
<attribute name='fullname'/>
<attribute name='telephone1'/>
<filter type='and'>
<condition attribute='accountid' operator='not-null'/>
<condition attribute='fullname' operator='not-null'/>
<condition attribute='gendercode' operator='not-null'/>
<condition attribute='telephone1' operator='not-null'/>
</filter>
<link-entity name='account' from='accountid' to='accountid' alias='Firmenname' link-type='natural'>
<attribute name='name'/>
</link-entity>
</entity>
</fetch>
if (crmForm.all.customer.DataValue != null)
{
var myAccountId = crmForm.all.customer.DataValue[0].id;
alert(myAccountId);
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>contact</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>parentcontactidname</q1:Attribute>" +
" <q1:Attribute>telephone1</q1:Attribute>" +
" <q1:Attribute>emailaddress1</q1:Attribute>" +
" <q1:Attribute>imp_mailsalutation</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>ContactId</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values> " +
" <q1:Value xsi:type=\"xsd:string\">myAccountId</q1:Value>" +
" </q1:Values> " +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </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;
var entityNode = resultXml.selectSingleNode("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
var FirmennameNode = entityNode.selectSingleNode("q1:parentcontactidname");
var telephone1Node = entityNode.selectSingleNode("q1:telephone1");
var emailaddress1Node = entityNode.selectSingleNode("q1:emailaddress1");
var gendercodeNode = entityNode.selectSingleNode("q1:imp_mailsalutation");
crmForm.all.companyname.DataValue = (FirmennameNode == null) ? null : FirmennameNode.text;
crmForm.all.telephone.DataValue = (telephone1Node == null) ? null : telephone1Node.text;
crmForm.all.emailaddress.DataValue = (emailaddress1Node == null) ? null : emailaddress1Node.text;
crmForm.all.espirit_briefanrede.DataValue = (gendercodeNode == null) ? null : gendercodeNode.text;
}
var resultXml = xmlHttpRequest.responseXML;
var entityNode = resultXml.selectSingleNode("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
alert(resultXml);
alert(entityNode);
"soap:ServerServer was unable to process request. 0x80041103 'Contact' entity doesn't contain attribute with Name = 'ContactId'. Platform"
"<?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"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request.</faultstring><detail><error>
<code>0x80040203</code>
<description>An exception System.FormatException was thrown while trying to convert input value 'myAccountId' to attribute 'contact.contactid'. Expected type of attribute value: System.Guid. Exception raised: GUID muss 32 Ziffern mit 4 Bindestrichen enthalten (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</description>
<type>Platform</type>
</error></detail></soap:Fault></soap:Body></soap:Envelope>"
var myAccountId = crmForm.all.customer.DataValue[0].id;
var trim_myaccountId = myAccountId.substring(1, myaccountId.length -1);
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>contact</q1:EntityName>" +
"<q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
"<q1:Attributes>" +
"<q1:Attribute>parentcustomerid</q1:Attribute>" +
"<q1:Attribute>telephone1</q1:Attribute>" +
"<q1:Attribute>emailaddress1</q1:Attribute>" +
"<q1:Attribute>imp_mailsalutation</q1:Attribute>" +
"</q1:Attributes>" +
"</q1:ColumnSet>" +
"<q1:Distinct>false</q1:Distinct>" +
"<q1:Criteria>" +
"<q1:FilterOperator>And</q1:FilterOperator>" +
"<q1:Conditions>" +
"<q1:Condition>" +
"<q1:AttributeName>contactid</q1:AttributeName>" +
"<q1:Operator>Equal</q1:Operator>" +
"<q1:Values> " +
"<q1:Value xsi:type=\"xsd:string\">trim_myaccountId</q1:Value>" +
"</q1:Values> " +
"</q1:Condition>" +
"</q1:Conditions>" +
"</q1:Criteria>" +
"</query>" +
"</RetrieveMultiple>" +
"</soap:Body>" +
"</soap:Envelope>" +
"";
5. Januar 2010 20:32
var myContactId = crmForm.all.customer.DataValue[0].id;
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>contact</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>fullname</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>contactid</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xmlns:q2=\"http://microsoft.com/wsdl/types/\" xsi:type=\"q2:guid\">" + myContactId + "</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </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;
var entityNodes = resultXml.selectNodes("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
for (var i = 0; i < entityNodes.length; i++) {
var entityNode = entityNodes[i];
var fullnameNode = entityNode.selectSingleNode("q1:fullname");
var fullname = (fullnameNode == null) ? null : fullnameNode.text;
}
alert(fullname);
6. Januar 2010 01:31
6. Januar 2010 01:32
6. Januar 2010 09:11
Tomiliy hat geschrieben:Frage: Wie prüfe ich denn ob wirklich "Person" ausgewählt ist?
Tomiliy hat geschrieben:Und kann ich NUR hier vor auswählen das Person eingestellt ist anstatt Firma?
Tomiliy hat geschrieben:Und kannst du mir bitte mal erklären wie ich dieses bekloppte Client side scripting ans laufen bekomme. Es gibts nirgends ne Erklärung und ich schnall das nicht.
7. Januar 2010 17:17
Tomiliy hat geschrieben: Tomiliy hat geschrieben:Und kannst du mir bitte mal erklären wie ich dieses bekloppte Client side scripting ans laufen bekomme. Es gibts nirgends ne Erklärung und ich schnall das nicht.
Da verstehe ich jetzt nicht ganz, was du meinst. Wenn du das von mir gepostete Script in das OnChange des Feldes Customer stellst, wird es funktionieren. Was funktioniert bei dir denn nicht?