Posts

Showing posts from November, 2008

Disable CRM Form through JavaScript

I often get the question how to disable a form, so here it is: The trick is to disable all the fields that are on the form. You can do this by using the following JavaScript: if (crmForm.FormType == 2) { for( var i = 0 ; i { if( crmForm.all[ i ].req) crmForm.all[ i ].Disabled = true; } } In the code I check if the form is in the update modus (FormType == 2), because I don't think that disabling a form while in create modus makes much sense. In the real world you'd probably disable a form depending on the value of another field. Would you like to keep some fields editable, you can do the following: if (crmForm.FormType == 2) { for( var i = 0 ; i { if( crmForm.all[ i ].req && crmForm.all[i].id != "name") crmForm.all[ i ].Disabled = true; } } Here I disable all fields except the name field (crmForm.all[i].id != "name"). You can add other fields according to your needs. Just make sure you use the sc...

Get Week Number in SQL Server

It happens frequently that certain clients want to see the weeknumber of certain dates in CRM reports. To accomplish this, you can use the following function in your query to get the week number for a given date: select datepart(ww,scheduledstart) from filteredappointment The above query will give you the weeknumber of the scheduled start date from the filtered appointments view. Kevin Dosseray

SQL Server 2005 Version

Want to know which SQL Server version you exactly have? Execute the following query and the SQL Management Studio will tell you: select @@version Kevin Dosseray

Adding Subareas to the SiteMap

When adding (or changing) subareas to the sitemap of CRM, you must make sure that you don't use the same ID for a subarea in the same area (even if the subareas are in different groups). For example: <Area Id="Workplace" ResourceId="Area_Workplace" ShowGroups="true" Icon="/_imgs/workplace_24x24.gif" DescriptionResourceId="Workplace_Description"> <Group Id="Customers" ResourceId="Group_Customers" DescriptionResourceId="Customers_Description"> <SubArea Id="nav_accts" Entity="account" /> <SubArea Id="nav_conts" Entity="contact" /> <SubArea Id="nav_leads" Entity="lead" /> </Group> <Group Id="SFA" ResourceId="Area_Sales" IsProfile="true" DescriptionResourceId="Sales_Description"> <SubArea Id="nav_leads1" Entity=...