Posts

Using FetchXml Retrieve more than 5000 records with XrmSvcToolkit in MS CRM

var pagingNo; var pageCookie = ""; var FetchXmlBuilder = function () {     return {         getPageCookie: function (a) {             return a;//.replace(/</gi, "&lt;").replace(/>/gi, "&gt;").replace(/\"/gi, "&quot;")         }     } }(); var Bind_Results = new Array(); function xrmSvcTooltRequest() {     var fetch = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' page='" + pagingNo + "' count='5000'  paging-cookie='" + pageCookie + "'>" +                 "<entity name='apy_jobpackagetasks'>" +                  "<attribute name='apy_jobpackagetasksid' />" +                  "<attribute name='apy_name' />" +                ...

html page with table inside another table

<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head>     <meta charset="utf-8" />     <title>Designing html page</title>     <style>         body {             font-family: Segoe\000020UI,Arial,sans\00002Dserif;             font-size: 12px;             color: #444;             padding: 0px;             margin: 0px;         }         table {             border-collapse: collapse;             width: 100%;         }         th {             border-bottom: none!important;             border-right: 1px solid #dd...

Association of records using plugin in MS CRM

using Microsoft.Xrm.Sdk; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk.Query; using Microsoft.Xrm.Sdk.Messages; namespace Marketing_List {     public class Account_Association:IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));             IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));             IOrganizationService service = factory.CreateOrganizationService(context.UserId);             if(context.InputParameters["Target"]is Entity && contex...

Association and Dissociation of records using plugin in MS CRM

using System; using System.Collections; using System.Text; using Microsoft.Xrm.Sdk; using System.Web; using System.Xml; using System.Diagnostics; using Microsoft.Xrm.Sdk.Query; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Messages; namespace Termination { ///// In Enquiry entity we are having the subgrid of CarrirerSupplierRateRequest and RateRequestAdditional /////1. Registering the Plugin on Create and Update CarrirerSupplierRateRequest entity /////2. CarrirerSupplierRateRequest is having the lookup are aki_enquirynumber and aki_raterequestadditionals /////3. Enquiry and RateRequestAdditional entities are having the N:N relationship /////4. creating and updating the CarrirerSupplierRateRequest entity with aki_raterequestadditionals lookup field we are updating the sub grid(raterequestadditionals) in Enquiry entity     public class AssociateAndDissociateRRA : IPlugin     {         public void Execute(IServiceProvid...

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);             ...

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' />" + ...

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 {   ...