Rearrange Navigation Items in Left Navigation Bar

Some time we need to rearrange left navigation item of left navigation bar, we can do this easily using JS “insertBefore()” function. Just we need to get element id of the left navigation items. We can use IE dev toolbar to do this; also if you are using IE 8 then IE dev toolbar will not work, as Microsoft has… Read more »

Calculate Number of Days between two Dates in MS CRM

Some time we need to calculate number of days between two dates in crm, we can easily do this using below JS script var d1=crmForm.all.FirstDate.DataValue; var d2=crmForm.all.SecondDate.DataValue; var DayValue=1000*60*60*24; alert(Math.ceil((d2.getTime()-d1.getTime())/DayValue)); Update for Dynamics 365 var d1=Xrm.Page.getAttribute(“FirstDate”).getValue(); var d2=Xrm.Page.getAttribute(“SecondDate”).getValue(); var DayValue=1000*60*60*24; alert(Math.ceil((d2.getTime()-d1.getTime())/DayValue));

Set CRM DateTime

Mahender   April 15, 2010   No Comments 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 »