Allora sto usando delle classi proprie del CRM
premetto che di Asp Net ne capisco pochino e quel poco che so lo conosco in VB
Ho trovato questo script in C# su MSDN ma mi da errori a bizzeffe...
codice:
<%@ Page Language="C#" Debug="true"%>
<%@ Import Namespace="Microsoft.Crm.Platform.Proxy" %>
<%@ Import Namespace="System.Net" %>
<Script Runat="Server">
// strServer should be set with the name of the platform Web server
string strServer = "boserver";

// virtualDirectory should be set with the name of the Microsoft CRM
// virtual directory on the platform Web server
string virtualDirectory = "MSCRMServices";
string strDir = "http://" + strServer + "/" + virtualDirectory + "/";

//BizUser proxy object
Microsoft.Crm.Platform.Proxy.BizUser bizUser = new Microsoft.Crm.Platform.Proxy.BizUser();
bizUser.Credentials = System.Net.CredentialCache.DefaultCredentials;
bizUser.Url = strDir + "BizUser.srf";

// CRMIncident proxy object
Microsoft.Crm.Platform.Proxy.CRMIncident incident = new Microsoft.Crm.Platform.Proxy.CRMIncident();
incident.Credentials = System.Net.CredentialCache.DefaultCredentials;
incident.Url = strDir + "CRMIncident.srf";
string strErrorMsg;
string strIncidentXml;
string strIncidentId;
string strAccountId = "{3E24E79C-7EC5-4473-95FF-7E46FEBB534B}";
string strCustomerId = "{ECF99EF1-3858-4E06-ABD9-EBFE526BF9FF}";

try
{
Microsoft.Crm.Platform.Proxy.CUserAuth userAuth = bizUser.WhoAmI();

// Set up the XML string for the new incident
strIncidentXml = "<incident>";
strIncidentXml += "<title>Incident 1</title>";
strIncidentXml += "<accountid>" + strAccountId +"</accountid>";
strIncidentXml += "<ownerid type=\"" + Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToString() +"\">";
strIncidentXml += userAuth.UserId + "</ownerid>";
strIncidentXml += "<customerid type=\"" + Microsoft.CRM.Flags.ObjectType.otSystemUser.ToString() +"\">";
strIncidentXml += strCustomerId + "</ownerid>";
strIncidentXml += "</incident>";

// Create an incident
strIncidentId = incident.Create(userAuth, strIncidentXml);
}
catch (System.Web.Services.Protocols.SoapException err)
{
// Process the platform error here
strErrorMsg = ("ErrorMessage: " + err.Message + " " + err.Detail.OuterXml + " Source: " + err.Source );
}
catch (Exception err)
{
// Process other errors here
strErrorMsg = ("ErrorMessage: " + err.Message );
}
</script>
Il primo errore è :
CS1519: Invalid token '=' in class, struct, or interface member declaration
qui :
codice:
Line 15: bizUser.Credentials = System.Net.CredentialCache.DefaultCredentials;
Qualcuno sa aiutarmi per favore....