Posts

Showing posts from February, 2018

Using Connection string Retrieve the service in MSCRM in C#

//// Required dll///// Microsoft.CSharp Microsoft.Crm.Sdk.Proxy Microsoft.IdentityModel.Clients.ActiveDirectory Microsoft.Xrm.Sdk Microsoft.Xrm.Tooling.Connector Microsoft.Xrm.Tooling.CrmConnectControl Microsoft.Xrm.Tooling.CrmConnector.Powershell System System.Core System.Data System.Data.DataSetExtensions Sysytem.Runtime.Serialization System.Security System.ServiceModel Sysytem.Web.Services System.Xml System.Xml.Linq //////Name spaces//// using System; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Messages; using Microsoft.Xrm.Sdk.Query; using Microsoft.Xrm.Tooling.Connector; ///using connection string Retrieve the service in MSCRM in C#  var connString = "AuthType=Office365;Username=test@test.onmicrosoft.com; Password=pass@word1;Url=https://test.crm4.dynamics.com";               Microsoft.Xrm.Tooling.Connector.CrmServiceClient conn = new CrmServiceClient(connString);               // Cast the proxy client to the IOrganizationService inter

Retrive more than 5000 record using paging concept in fetchxml using c# MSCRM

 private List<Entity> GetDestinationRecords1()         {             List<Entity> AllRecords = new List<Entity>();             try             {                 int fetchCount2 = 5000;//                 int pageNumber2 = 1;                 string cookie2 = null;                 bool HasMoreRecords2 = true;                 //Guid id=new Guid("1BA1BCB9-20B6-E611-80FB-5065F38B2531");                 string fetchXml2 = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +   "<entity name='contact'>" +     "<attribute name='telephone1' />" +     "<attribute name='contactid' />" +     "<attribute name='emailaddress1' />" +     "<attribute name='lastname' />" +     "<attribute name='firstname' />" +     "<order attr

PreImage and PostImage Plugin Senario in mscrm

PreImage and PostImage Plugin Senario in mscrm PreImage  Plugin: preimage plugin is used on account related contact having subgrid on Account related Contact Deleted. Ex: Account has totalAmount field and Contact has Quantiy(Q) and CostPerUnit(CPU) fields. account(TotalAmount)=1Con+2Con+3Con; account(TotalAmount)= 1Con(Q*CPU)+3Con(Q*CPU)+2Con(Q*CPU); PostImage Plugin: PostImage Plugin is used on Account related Contact on having subgrid on Account related Contact and update the value either Quantiy(Q) and CostPerUnit(CPU) fields. account(TotalAmount)=1Con+2Con+3Con; account(TotalAmount)= 1Con(Q*CPU)+3Con(Q*CPU)+2Con(Q*CPU); Register the Plugin on (Create and Delete)Updating the Contact on Quantity and CostPerUnit and ContactLookup fileds using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; namespace CreateBookingMovementFromEnquiry {     public c