One of our client wanted to move CRM Server from One Data Centre to different data centre but due to some constraint we could not move it by creating New Organization or by new deployment. We had only left option was update IP address manually. Recently we moved our CRM Server from one data centre [...]
Archive for the ‘Microsoft .NET’ Category
Moving CRM Servers(Application and Database) to New DataCentre
Posted: February 26, 2012 in CRM 2011, CRM5, Microsoft .NET, Microsoft Dynamics CRM, SQL ServerTags: CRM, Data Centre, DeploymentProperty, Microsoft Dynamics CRM, Migration, Migration To New Data Centre, Move servers to new Data Centre, MSCRM_Config
Send Email using Template
Posted: July 28, 2010 in Microsoft .NET, Microsoft Dynamics CRMTags: Email, Send Email, Template
public void SendMail(ICrmService service,Guid ownerID, Guid fromGuid, ArrayList toGuid,Guid recordRegardingID,Guid templateId,Enum enitityName) { // Create an instance of email email myEmail = new email(); //set the owner of the mail myEmail.ownerid = new Owner(); myEmail.ownerid.type = EntityName.systemuser.ToString(); myEmail.ownerid.Value = ownerID; // specify the from part of the email activityparty from = new activityparty(); from.partyid = [...]
Revoke Access To Entity
Posted: July 28, 2010 in Microsoft .NET, Microsoft Dynamics CRMTags: CRM, Revoke Access, Sharing
private bool RevokeAccessToEntity(ICrmService service, Guid guidValue, Guid entityID, string EntityName) { bool isSuccess = false; // Create the SecurityPrincipal object. SecurityPrincipal principal = new SecurityPrincipal(); // PrincipalId is the GUID of the team whose access is being revoked. principal.Type = SecurityPrincipalType.Team; principal.PrincipalId = guidValue; // Create the target for the request. TargetOwnedDynamic target = new [...]
AutoNumber Plug-In for Custom Entity In CRM 4.0
Posted: July 28, 2010 in Microsoft .NET, Microsoft Dynamics CRMTags: AutoNumber, CRM, Plug-Ins
using System; using System.Collections.Generic; using System.Text; using Microsoft.Crm.Sdk; using Microsoft.Crm.SdkTypeProxy; using Microsoft.Crm.Sdk.Query; using System.Web.Services.Protocols; namespace CRM.Customization.AutoNumber { public class AutoNumberPlugIns:IPlugin { DynamicEntity entity = null; int startNumber; string prefix = string.Empty; string seperator = string.Empty; int nextMaxNumber; string uniqueId = string.Empty; #region IPlugin Members public void Execute(IPluginExecutionContext context) { if (context.InputParameters.Properties.Contains(“Target”) && context.InputParameters.Properties["Target"] is DynamicEntity) [...]
Using Update Method of CrmService WebService
Posted: July 28, 2010 in Microsoft .NET, Microsoft Dynamics CRMTags: Update, WebService
Using Create Method of CrmService WebService
Posted: January 20, 2009 in Microsoft .NET, Microsoft Dynamics CRMTags: Create, WebService
// Set up the CRM Service. CrmAuthenticationToken token = new CrmAuthenticationToken(); // You can use enums.cs from the SDK\Helpers folder to get the enumeration for AD Authentication. token.AuthenticationType = 0; token.OrganizationName =”AdventureWorksCycle”; CrmService service = new CrmService(); service.Url =”http://<servername>:<port>/mscrmservices/2007/crmservice. asmx”; service.CrmAuthenticationTokenValue = token; service.Credentials = System.Net.CredentialCache.DefaultCredentials; // Create the column set object that indicates the [...]
Using the CrmDiscoveryService Web Service In CRM4.0: On-Premise
Posted: January 20, 2009 in Microsoft .NET, Microsoft Dynamics CRMTags: CrmDiscoveryService, WebService
CrmDiscovery service is a global installable level service that allow the caller to determine the correct organization and URL for his/her need. Below example show how to create and configure CrmDiscoveryService Web Service proxy. // Create and configure the CrmDiscoveryService Web service proxy. CrmDiscoveryService discoveryService = new CrmDiscoveryService(); discoveryService.UseDefaultCredentials = true; discoveryService.Url =”http://localhost/MSCRMServices/2007/AD/CrmDiscoveryServic e.asmx”; [...]
Creating AutoNumber for Microsoft Dynamics CRM 4.0 using Plug-Ins with the help of FilteredView
Posted: December 22, 2008 in Microsoft .NET, Microsoft Dynamics CRMTags: AutoNumber, Microsoft Dynamics CRM
Create two field as we created.. 1) New_uniqueid ( Int) 2) New_id( nvarchar). If you want AutoNumber as Int , no need to create two fields ,but we wanted AutoNumber as in specific format(OP/DEC08/0000000001) so we reqired to two field. Steps for AutoNumber: 1) Retrieved the maximum number for entity based on field new_uniqueid. 2) [...]
Using FilteredView to retrieve data in Plug-In or Callout
Posted: December 12, 2008 in Microsoft .NET, Microsoft Dynamics CRMTags: FiltededView, Plug-In, Plug-Ins, Retrieve Data
To retrieve data from CRM Database( FilteredView)….. SqlConnection connection = new SqlConnection(“DataSource=<dsName>;Initial Catalog=<databaseName> ;Integrated Security=SSPI;”); string sqlQuery = @” select max(new_uniqueid) from FilteredView” ; SqlCommand cmd = new SqlCommand(sqlQuery, connection); connection.Open(); /// Write Logic here connection.Close(); But this code wasn’t returning any results .It was because callout/plugin run under the context of [...]
How to Call Web Service from Java Script
Posted: July 18, 2008 in Microsoft .NET, Microsoft Dynamics CRMTags: Ajax, JScript, WebService
Here we will be calling the default helloworld webservice that is already created for us when we open a asp.net webservice project template in Visual Studio. We’ll just have a textbox(html control) which will display us the Hello World! response returned from the web service. This is the step we need to follow 1) Create [...]

