22. März 2010 09:14
22. März 2010 12:39
22. März 2010 12:56
22. März 2010 15:20
<%@ Page Language="C#" CodeFile="check.aspx.cs" Inherits="Website.Check" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<head runat="server">
<title>Unbenannte Seite</title>
</head>
<body onload="self.close(); window.open('<%=getURL()%>'); ">
</body>
</html>
using System.Web.UI;
namespace Website
{
public partial class Check : System.Web.UI.Page
{
protected string getURL()
{
string kdnr = Request.QueryString["kdnr"];
string angnr = Request.QueryString["angnr"];
string aufnr = Request.QueryString["aufnr"];
string url = "http://www.google.de";
return url;
}
}
}
22. März 2010 15:30
if (crmForm.all.new_parentcustomerid.DataValue != null)
{
var myAccountId = crmForm.all.new_parentcustomerid.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>account</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>new_parentagentid</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>";
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;
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:new_parentagentid");
if (nodeNumber.length == 1)
{
var myParentAgentID = nodeNumber[0].text;
//alert(myParentAgentID);
}
}
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>emailaddress1</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\">" + myParentAgentID + "</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;
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:emailaddress1");
if (nodeNumber.length == 1)
{
var myEmailaddress = nodeNumber[0].text;
//alert(myEmailaddress);
crmForm.all.new_vertreteremail.DataValue = myEmailaddress;
}
}
}
22. März 2010 16:14
22. März 2010 16:39
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected function getKDNR() as string
dim kdnr as string = Requset.QueryString("kdnr")
return kdnr
End function
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Unbenannte Seite</title>
</head>
<body onload="self.close(); window.open('<%=getKDNR()%>'); ">
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
sub Page_Load(byval sender as object, byval e as EventArgs ) Handles MyBase.Load
Me.Label1.Text = Requset.QueryString("kdnr")
Me.Label1.ForeColor = Drawing.Color.Green
end sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Unbenannte Seite</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Italic="True" Font-Names="Arial" Width="441px" Font-Size="9pt"></asp:Label>
</form>
</body>
</html>
22. März 2010 17:37
<%@ Page Language="VB" CodeFile="check.aspx.vb" Inherits="Check" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<head runat="server">
<title>Unbenannte Seite</title>
</head>
<body onload="self.close(); window.open('<%=getURL()%>'); ">
</body>
</html>
Imports System.Web.Services
Public Class Check
Inherits System.Web.Services.WebService
' Dein Quellcode.
End Class
23. März 2010 09:15
23. März 2010 10:43
<script type="text/javascript">
var myKDNR = '10007';
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\">" +
"<soap:Header>" +
"<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"0" +
"</AuthenticationType>" +
"<OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"tw-elektric" +
"</OrganizationName>" +
"<CallerId xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"527E9A8C-C681-DE11-90BB-00237D2ECAB3" +
"</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>account</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>accountid</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>accountnumber</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + myKDNR + "</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>"
"</soap:Envelope>";
alert(xml);
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("status = " + resultXml);
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
alert (resultXml);
var nodeNumber = resultXml.selectNodes("//q1:accountnumber");
alert(nodeNumber.length);
if (nodeNumber.length == 1)
{
var myAccountID = nodeNumber[0].text;
alert(myAccountID);
}
if(xmlHttpRequest.status == 200)
{
// Capture the XMLHttp response in XML format.
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:new_parentagentid");
if (nodeNumber.length == 1)
{
var myAccountID = nodeNumber[0].text;
alert(myAccountID);
}
}
</script>
23. März 2010 12:16
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<head>
<title>Unbenannte Seite</title>
</head>
<body>
<script type="text/javascript">
var myKDNR = '10007';
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\">" +
"<soap:Header>" +
"<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"0" +
"</AuthenticationType>" +
"<OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
//hier muss der Name deiner CRM Organisation stehen!
//wenn der Name nicht stimmt funktioniert die Authentifizierung nicht richtig.
"tw-elektric" +
"</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>account</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>accountid</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>accountnumber</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + myKDNR + "</q1:Value>" +
" </q1:Values>" +
" </q1:Condition>" +
" </q1:Conditions>" +
" </q1:Criteria>" +
" </query>" +
" </RetrieveMultiple>" +
" </soap:Body>" +
"</soap:Envelope>";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
//hier muss die Adresse zu deinem CRM Server stehen! also http://<server>:<port>/mscrmservices/2007/CrmService.asmx
xmlHttpRequest.Open("POST", "http://192.92.130.9:5555/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;
//Alles was ich hier weggelöscht habe, war absolut unnötig.
if(xmlHttpRequest.status == 200)
{
var resultXml = xmlHttpRequest.responseXML;
//Du willst ja hier die AccountId bekommen und nicht den ParentAccount....
var nodeNumber = resultXml.selectNodes("//q1:accountid");
if (nodeNumber.length == 1)
{
var myAccountID = nodeNumber[0].text;
alert(myAccountID);
}
}
</script>
</body>
</html>
23. März 2010 12:32
23. März 2010 12:58
var qs = new Querystring();
//var myKDNR = '10007';
var myKDNR;
if (qs.contains('kdnr'))
{
myKDNR = qs.get('kdnr');
}
23. März 2010 13:15
<script type="text/javascript">
var qs = new Querystring();
var myKDNR;
if (qs.contains('kdnr'))
{
myKDNR = qs.get('kdnr');
}
//var myKDNR = '10761';
var myAUFNR = '412526';
var myANGNR = '118670';
//KUNDEN GUID herausfinden
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\">" +
"<soap:Header>" +
"<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"0" +
"</AuthenticationType>" +
"<OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"tw-elektric" +
"</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>account</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>accountid</q1:Attribute>" +
" <q1:Attribute>name</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>accountnumber</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + myKDNR + "</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", "http://192.92.130.9:5555/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;
if(xmlHttpRequest.status == 200)
{
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:accountid");
if (nodeNumber.length == 1)
{
var myAccountID = nodeNumber[0].text;
alert(myAccountID);
}
var nodeNumber = resultXml.selectNodes("//q1:name");
if (nodeNumber.length == 1)
{
var myAccountName = nodeNumber[0].text;
alert(myAccountName);
}
}
if (myAUFNR.length != 0)
{
//AUFTRAG GUID herausfinden
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\">" +
"<soap:Header>" +
"<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"0" +
"</AuthenticationType>" +
"<OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"tw-elektric" +
"</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>new_order</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>new_orderid</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>new_auftragnummer</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + myAUFNR + "</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", "http://192.92.130.9:5555/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;
if(xmlHttpRequest.status == 200)
{
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:new_orderid");
if (nodeNumber.length == 1)
{
var myOrderID = nodeNumber[0].text;
alert(myOrderID);
var URL = "http://localhost:5555/tw-elektric/activities/phone/edit.aspx?partyid=" + myAccountID +
"&partyType=1&partyName=" + myAccountName +
"&pId=" + myOrderID + "&pType=10002&pName=" + myAUFNR;
window.open(URL);
}
}
}
if (myANGNR.length != 0)
{
//AUFTRAG GUID herausfinden
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\">" +
"<soap:Header>" +
"<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"0" +
"</AuthenticationType>" +
"<OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">" +
"tw-elektric" +
"</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>new_offer</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>new_offerid</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1:Distinct>false</q1:Distinct>" +
" <q1:Criteria>" +
" <q1:FilterOperator>And</q1:FilterOperator>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>new_angebotnummer</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
" <q1:Values>" +
" <q1:Value xsi:type=\"xsd:string\">" + myANGNR + "</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", "http://192.92.130.9:5555/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;
if(xmlHttpRequest.status == 200)
{
var resultXml = xmlHttpRequest.responseXML;
var nodeNumber = resultXml.selectNodes("//q1:new_offerid");
if (nodeNumber.length == 1)
{
var myOfferID = nodeNumber[0].text;
alert(myOfferID);
var URL = "http://localhost:5555/tw-elektric/activities/phone/edit.aspx?partyid=" + myAccountID +
"&partyType=1&partyName=" + myAccountName +
"&pId=" + myOfferID + "&pType=10001&pName=" + myANGNR;
window.open(URL);
}
}
}
</script>
23. März 2010 13:29