Skip to main content

Posts

Showing posts with the label Dynamics CRM 2016

Web Api function in CRM 2016 C#

This is webapi C#    public class EntityRepository : Repository where T : Crmbaseentity     {         public async Task Add(T entity, string EntityName)         {             using (HttpClient client = new HttpClient(new HttpClientHandler() { Credentials = new NetworkCredential(this.UserName, this.Password, this.Domain) }))             {                 HttpResponseMessage response = await HttpClientExtensions.SendAsJsonAsync (client, HttpMethod.Post, this.CrmHost + EntityName, entity);                 if (response.IsSuccessStatusCode)                 ...

Duplicate Detection custom plugin C# Dynamics CRM 2016,2013,2011

using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DuplicateDetection {     public class Plugin : IPlugin     {         void IPlugin.Execute(IServiceProvider serviceProvider)         {             IPluginExecutionContext context             = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));             IOrganizationServiceFactory serviceFactory     = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));             IOrganizationService service     ...

Auto Number Generation MS CRM 2016,2013,2011 through plugin C#

In this article I am showing you how you can generate number sequence of a specific record of specific entity. here are the step Step:1     First of all create an Entity " new_autonumber " Step:2 after that you will need to create the fields. new_entityattributename (field name which you need to use as primary column of Entity .Mostly new_name are the primary attribute in ms crm) new_number (you don't need to add anything here. this field will show how much number record created of specific entity) new_prefix (this field use to prefix for number sequence) new_typename (entity name will be set in this field) Step:3 Set these fields on form and views Step:4 download my plugin from github. https://github.com/rrizwann/DynamicsCRM download AutoNumberGeneration folder Code are shown here. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsof...

CRM 2016 webapi limitation

 multiple level of expansion in crm webapi 2016 Solution : Multi level expansion is not allows in  crm 2016 webapi not allowed http://serverurl/api/data/v8.0/new_medicalcase(caseid)?$expand=new_patientcase_mcfamily($expand=new_name($select=fullname)) allowed http://serverurl/api/data/v8.0/new_patientcase(caseid)?$expand=new_patientcase_mcfamily   Can't query date values Solution :  allowed /contacts?$select=fullname,birthdate&$filter=birthdate eq 1990-01-01 not allowed  /contacts?$select=fullname,birthdate&$filter=birthdate eq '1990-01-01'

generate OptionSet Class through SDK. CRM 2016

In this article I am generating  OptionSet Class through SDK. CRM 2016 Please follow the steps. You can add this class in your plugin and custom C# project.  Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7:     Step 8:    Command: CrmSvcUtil.exe /codewriterfilter:"Microsoft.Crm.Sdk.Samples.FilteringService, GeneratePicklistEnums" /codecustomization:"Microsoft.Crm.Sdk.Samples.CodeCustomizationService, GeneratePicklistEnums"  /namingservice:"Microsoft.Crm.Sdk.Samples.NamingService, GeneratePicklistEnums" /url :http://crm-02:5555/dynamicscrm/XRMServices/2011/Organization.svc /out:OptionSets.cs /interactivelogin:true You need to change the highlighted service url.