Posts

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=...

Scribe Certified!

Last week I managed to become Scribe Certified! In order to get the certification I had to pass 2 exams: Scibe Server and Sribe MSCRM Adapter. You can take the exams online so it is possible to look stuff up if you don't know the answer right away. The exams are not that easy, but if you have experience with the product and have read the training materials you should do just fine. Kevin Dosseray

Not able to access CRM on Server with Host Header

After applying a host header to my MSCRM 4.0 website, I was able to connect to CRM on a client PC, but on the server itself I always received a "HTTP 401.1 - Unauthorized" error. After some searching around, I found the solution to my problem in the following KB article: http://support.microsoft.com/default.aspx?scid=kb;en-us;896861 It seemed that the loopback check security feature on my Windows 2003 server was causing the problem. Kevin Dosseray

Customizations File too Big to Upload

Recently I had a problem trying to upload my customizations file (Settings -> Customizations -> Import Customizations -> Upload). I wasn't able to upload the file. After clicking the button "Upload", the button greyed out and nothing else happened. The problem was that my customizations file was too big. The file was about 10MB and apparently CRM doesn't default allow http requests of files bigger than 8MB. Fortunatly you can change this setting: go to your location where you installed the CRM website (default this is "c:\program files\microsoft dynamics crm\crmweb") and open the web.config. In the web.config locate the following line: Change the maxRequestLength to a value big enough to handle your file (in my case this was 11000). Kevin Dosseray