Set CRM DateTime

Mahender   April 15, 2010   1 Comment on Set CRM DateTime

Some time we need to set crmdatetime based on input value for year,month,date so we can create datatime variable in .net as DateTime _DateTime=new DateTime(2010,4,15);   so it will result like “4/15/2010 00:00:00” But if you will try to assign this value to crmdatetime like CrmDateTime _CrmDateTime = new CrmDateTime(); _CrmDateTime.Value=_DateTime.ToString(); you will get a date-time format exception in crm As CrmDateTime class… Read more »

Code Optimization

One of our client come to us with Performance issue, they have multiple plugins written on many OOB as well as in custom entities. They also approached to Microsoft for this. Microsoft recommended them to stop making call to crm webservice and retrieve only required columns. Addition to these, I noticed some other points All plugins were deployed in debug… Read more »

Navigation Control through Sitemap

Today I got requirement from one of my client for dynamics crm online, that they just want to show only Workplace and Setting navigation to all users except System Admin. The first thing that came in my mind to set Privilege attribute for all Subarea in all navigation with “All” for example for account to use like as below <Privilege… Read more »

Update Entity Record Using Dynamic Entity

I want to share somecode to update entity using dynamic entity with all //Create ICrmService object ICrmService  _iCrmserviceObject=context.CreateCrmService(true); //Create Dynamic entity object  DynamicEntity _DynamicEntity = new DynamicEntity(); //Assign name of entity which you want to update let’s say account             _DynamicEntity.Name = “account”; //We have to add properties to dyanic entity that we want to update //we can add directly… Read more »

Custom Workflow To get Datetime for the specified day of the week

One of my client ask me to develop a custom workflow for Following Date Manipulation functions Get the day of the week from a datetime field Get the date only part of a date time field to a workflow variable Get the time only part of a date time field to a workflow variable Get the datetime value for the… Read more »

Custom WorkFlow Activity DateTimeInput Issue

I got requirement to get Date for next weekday based on the weekday index input For example if you need to check what the date on next Monday is, As obvious I created two workflow input variables and wrote logic to get next weekday date. But I found the custom workflow not working because of the because of the datetime… Read more »

Setting From & To Partylist for Activities

If we are creating activity like email,phonecall, letter,fax we need to set sender & recipient activityparty. we can set activitypart using following code  I am creating letter activity DynamicEntity LetterAct = new DynamicEntity(“letter”); //create regardingobjectid LookupProperty _Regarding = new LookupProperty(); _Regarding.Name = “regardingobjectid”; _Regarding.Value = new Lookup(“regarding entity name”,GUID of entity instance); LetterAct.Properties.Add(_Regarding); //set from and to  DynamicEntity[] _ActivityParties =… Read more »

Calling External WebService using JS

 Sometimes we need to call External webservice using JS, i have written a function to call external webservice Here is the function, you can modify it according to your requirements function CallCustomWebService(FunctionName, ParameterNameList, ParameterValueList, ProxyURL) {//FunctionName-Name of the function to call //ParameterNameList-Array of Parameter names in your proxy function //ParameterValueList-Array of Parameter value //ProxyURL-URL of your proxy var CallingFunctionURL = “http://tempuri.org/”… Read more »