Skip to main content

Posts

Showing posts from 2017

Connot disposed object. Object Name 'System.serviceModelSecurity.TransportSecurityProtocol'

 I and working n ASP.NET WebApi application with some code that calls that Get method to get a OrganizationServiceProxy object, and then proceeds to call various methods on that OrganizationServiceProxy object. For example, part of the login process does this. The way your Get method works is, each time it is called, it will first close the OrganizationServiceProxy object that it returned previously (regardless of whether or not it is still being used) then create and return a new one. Imagine two users attempt to log in to your application at almost the same time - within milliseconds of each other. The thread handling the first user's login calls Get and gets its OrganizationServiceProxy object, then a millisecond later the thread handling the second user's login calls Get, which causes the first thread's OrganizationServiceProxy object to be closed. However, the first thread is still running, and now when it attempts to call a method on it's OrganizationServ

Create Lead CRM 2011 online using Webservice and Html 5 responsive Page

Hi Guys I am writing a new Article which is quite interesting, I use CRM 2011 Online version first time and got an idea, if we connect our company website contact us page to CRM Lead then we can improve our sale Here is the Example which I create Lead in CRM through simple asp.net website. I design this website to HTML 5 so, Website can open in any browser any mobile any tablet .I have tested in multiple Mobile Sets. This is best example of responsive application   Web Version Mobile Version How to Work? Back End Code   Hi Guys I am writing a new Article which is quite interesting, I use CRM 2011 Online version first time and got an idea, if we connect our company website contact us page to CRM Lead then we can improve our sale Here is the Example which I create Lead in CRM through simple asp.net website. I design this website to HTML 5 so, Website can open in any browser any mobile any tablet .I have tested in mul

Unable to log on to Microsoft Dynamics AX

Unable to log on to Microsoft Dynamics AX” error message when opening the AX client” Currently somehow the other I was unable to log on my local vm, and I used another user to log on and try to connect with dynamics Ax. I got the Error “Unable to log on to Microsoft Dynamics AX” error message when opening the AX client” On Searched found that have to made User as admin on Dynamics Ax and then log in with it. This scenario also occurred, when dynamics ax back restored on local vm. where Development environment user is not register in other environment. This is  two step process. First have to get User sid on domain. This is done by using power shell script. I used following script run in powershell  to get user sid. $AdObj = New-Object System.Security.Principal.NTAccount("AXAdmin") $strSID = $AdObj.Translate([System.Security.Principal.SecurityIdentifier]) $strSID.Value Copy the Sid and paste it in following SQL statement. update userinfo set networkdomain =

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                 = (IOrganizationService)serviceFactory.CreateOrganizationService(context.UserId);             ITracingService tracingService                 = (ITracingService)serviceProvider.GetService(typeof(ITracingService));             if (context.InputParameters.Contains("Target") && context.InputParameters["Targ

Startup Dynamics 365

Step 1: Visit the link for signup Dynamics 365 https://signup.microsoft.com/Signup?OfferId=bd569279-37f5-4f5c-99d0-425873bb9a4b&dl=DYN365_ENTERPRISE_PLAN1&Culture=en-us&Country=us&ali=1 Check All of these Enjoy the fantastic Dynamics 365 for 30 days trial :) You can download the sdk of dynamics 365 from the link below.

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.

Retrieve many to many relation MS CRM 2016 query expression C#

string entity1 = " mzk _ dosageform "; string entity2 = " mzk_ordersetup "; string relationshipEntityName = " mzk_mzk_dosageform_mzk_route ";          LinkEntity linkEntity1 = new LinkEntity(entity1, relationshipEntityName, "mzk_dosageformid", "mzk_dosageformid", JoinOperator.Inner); LinkEntity linkEntity2 = new LinkEntity(relationshipEntityName, entity2, "mzk_ordersetupid", "mzk_ordersetupid", JoinOperator.Inner); linkEntity2.Columns = new Microsoft.Xrm.Sdk.Query.ColumnSet("mzk_ordersetupid", "mzk_code", "mzk_description"); linkEntity2.EntityAlias = "OrderSetup"; linkEntity1.LinkEntities.Add(linkEntity2); query.LinkEntities.Add(linkEntity1); linkEntity2.LinkCriteria = new FilterExpression(); linkEntity1.LinkCriteria.AddCondition(new ConditionExpression("mzk_dosageformid", ConditionOperator.Equal, Dosage)); SoapEntityRepository entityRepository = new SoapEntityRep

Soap Entity Repository Class MS CRM 2016 Part 1

 Hi guys hope you all are good.  Today I am writing a new article for the CRM developer and this will help the you alot.  I have created Entity repository class which perform different opertion in crm. I will tell you how to call these method in my next article.  public class SoapEntityRepository : Repository     {         private IOrganizationService _service;         private OrganizationServiceProxy proxyService;   // get CRM Service Object         public IOrganizationService GetCRMService(string UserName,string Password, string Domain)         {             ClientCredentials credentials = new ClientCredentials();             credentials.Windows.ClientCredential = new System.Net.NetworkCredential(UserName, Password,Domain);             Uri organizationUri = new Uri(this.CRMServie);             proxyService = new OrganizationServiceProxy(organizationUri, null, credentials, null);             _service = (IOrganizationService)proxyService;             return _service;         }   //