CRM Custom Attributes

‘Wrong value type is passed to the control…’ for CRM 3.0 Custom Attribute
 
Microsoft Dynamics CRM 3.0 is one of those applications that is amazing in its flexibility and power but can be frustrating when you are challenged by unexpected issues. Whilst working on some custom attributes for a  CRM form today I started to get error being raised when I was saving information to one of these custom attributes. After a little surfing I found that other people had come accross this problem and it seems to stem from reusing a schema name for custom attributes.
 
For example;
  • create a custom attribute with a schema name of new_fieldname and assign it a field type of nvarchar.
  • add the new attribute to a form and publish the form.
  • remove the field from the form and then delete the attribute from the list of attributes.
  • create a second custom attribute with the same schema name but assign it a different field type e.g. float.
  • add the custom attribute back onto the same form and publish the form.
  • When you try to save data to the form you get the ‘Wrong value type is passed to the control…’ error.

The solution, or the one that I have found to work for me, is to make sure that after you delete the original custom attribute from the form you publish the form before you create the second attribute with the same name but different type. This allows CRM to completely remove any references to the original custom attribute.

Some problems are really well hidden!

error ASPPARSE: Could not load type… when building a Web Deployment Project
 
Whilst trying to build a Web Deployment project for my ASP.NET 2.0 Web Application I kept getting this strage compiler error that referenced a page that did not exist in my project. After looking at numerous sites where a similar issue occurred I finally came across this one that solved my problem – http://mis.cellaneo.us/PermaLink,guid,33daa7bb-101b-45ce-a520-a60a1bfa062e.aspx
 
Basically, an old page that did exist in my web project but had not been completely deleted was still hanging around and needed permanently removing – it had been excluded from the project but not removed. Once I had deleted the ‘hidden’ file I was able to successfully compile my web deployment project.

Visual Studio Run Time Error and

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. Access is denied
 
This one was a bit of an odd one! Whilst trying to debug an ASP.NET 2.0 Web Application from within VS 2005 I started to get these errors, but I couldn’t figure out what I had changed that caused my homepage to stop loading when it had been working fine 5 minutes before. I tried recycling the application pool, restarting Visual Studio and banging my head against the wall.
 
So I retraced my steps and realised that I had been amending the <identity> element in my web.config file. I had set the impersonation attribute to True and set the username and password elements accordingly. The issue was that the domain user I had specified was not being recognised on the development server, for some reason that I am still trying to phathom. To solve my problem I had a couple options;
  • Change the domain user so that they have more permissons.
  • Add the domain user to the local administrators group on the development server.

Having made the change and recycled the application pool for good measure, I was able to access my webpage once again.

Time to RTFM!

Displaying the list of recently used programs within Vista
 
Having rebuilt my desktop using Windows Vista SP1 (32-bit) I was getting a bit confused as to why my list of recently used programs where showing up empty?  I had made sure that the relevant option had been selected within the Start menu properties…
 
 
 Start Menu
 
But still nothing was appearing on my Start Menu and I wondered if I had found a bug in my SP1? It turns out that I should read the next page of the Vista manual. Click the Customize… button and Hey Presto!
 
 Start Menu - Customize
 
Under the Start menu size option my Number of recent programs to display was set to zero. No idea why it was set to that value and I dont remember setting it to zero, but once I had increased the value my recently used list of programs started showing up.

Using Integrated & Host Header values within IIS

Integrated Security & Host Headers within IIS
 
I recently had to create a new website on an intranet for one of our clients. I have done this task numerous times before and was not expecting too many problems. I had already configured the CNAME entry on the DNS server, created my virtual directories and updated the security settings for the site to use Integrated Security.
 
When I browsed to the home page for my site I was a little surprised to see a login dialog box asking for my username and password and then even more surprised when it would not recognise my details. I was presented with an IIS error page. I checked my settings for the security zone that the site was running under, in this case a Trusted Site. I made sure that the ‘Automatic login with current username and password’ option was set, double checked my website settings and also checked my web.config file.
 
Having exhausted all the obvious issues I decided it was time to surf the net for a suitable solution. Sure enough Microsoft came up trumps with a useful article Authentication may fail with "401.3" Error if Web site’s "Host Header" differs from server’s NetBIOS name http://support.microsoft.com/kb/294382 . After updating the server using the SetSPN tool I was able to surf to my new website without being promted for my credentials or getting IIS authorization errors.
 
 

Unknown Device in Device Manager

‘Unknown Device’ listed in the Device Manager
 
If you are having trouble getting Windows to recognise a piece of your hardware in the Device Manager and scanning for updates did not solve the problem then have a go at this solution;
 
  1. Open the Windows Device Manager
  2. Open the properties for the device in question.  Click the Details tab. Make sure that "Device Instance Id" is selected in the drop-down menu on this tab.
  3. You will then see a string like  this : PCIVEN_8086&DEV_2658&SUBSYS….
  4. In the example  above 8086 (after VEN_) is the Vendor ID and 2568 (after &DEV_) is the Device ID.
  5. Go to http://pcidatabase.com and type the appropriate values into the Vendor Search and/or Device Search using the Vendor ID and Device ID you have just found.
  6. Refer to the Vendors web site for the appropriate drivers for the device.

 

The force of good turns evil!

Compiler Error Message: CS0016: Could not write to output file
 
This pain in the ass caused myself and a colleague a days worth of scratching arounf trying to resolve. We were both developing multi-project applciations within VS2003 (although I believe this affect VS2005 as well) and getting this error when trying to compile EXE’s. Web projects and DLLs were fine but we could not figure out what was wrong.
 
I looked at http://support.microsoft.com/?id=313512 and http://support.microsoft.com/default.aspx?scid=kb;en-us;825791 and even http://support.microsoft.com/?kbid=867770 but nothing really matched the problem that we were getting. It wasn’t until I came accross this post http://dotnetfish.blogspot.com/2008/01/compiler-error-message-cs0016-could-not.html that the answer was revealed.
 
A new AV policy had been applied to the machine that restricted write access to the TEMP folder. This was stopping Visual Studio from creating the EXE I was trying to compile as it uses the TEMP folder during the compilation process.

Windows Mobile 6 And Windows Mobile Device Center on Vista

Upgrading from Windows Mobile 5 to Windows Mobile 6 with Vista
 
Having successfully upgraded my i-mate JasJam from WM5 to WM6 I found that when I came to sync my device with my Vista laptop (32-bit Business Edition) the process would not succeed. It would say ‘Syncing’, but not actually perform any operations. Having installed version 6.1 of WMDC and successfully got it to sync with my WM5 device I was a little, but not entirely, surprised that it failed to synchronise.
 
Having double checked my Synchronisation settings and made sure my certificate was installed correctly I decided to reinstall the WMDC. Initially I just tried running the Repair option on the WMDC installation but that did not have any success so I completely removed the WMDC Driver Update and the WMDC itself. After rebooting the machine, just to make sure, I downloaded the latest version of the WMDC again and did a brand new install.
 
This solved my problem. The driver update installed successfully along with the WMDC and when I plugged my JasJam into the laptop the WMDC recognised, connected and sync’ed straight away. Open-mouthed

Reporting Services – SetExecutionParameters

Passing in Read-Only parameters to the Reporting Services Web Service
 
Just a quick one – I have recently been generating dynamic RDL’s and then using the Reporting Services Web Service to load and render the reports. One little headache I did have was defining the parameters for the reports using the SetExecutionParameters method. One of my parameters is read-only and as such when I tried to pass it to the report I got a nice error back informing me of this.
 
I spent some time looking around to determine how I pass a read only parameter to a report without any luck. Then it dawned on me . . . just don’t add the parameter to the prameter array . . . and make sure you reduce the array size by one. So my code now loooks like this;
 
    ReportExecutionWS.ParameterValue[] parameters = new ReportExecutionWS.ParameterValue[3];
    parameters[0] = new ReportExecutionWS.ParameterValue();
    parameters[0].Name = "Version";
    parameters[0].Value = "1.0.0";
    parameters[1] = new ReportExecutionWS.ParameterValue();
    parameters[1].Name = "ReportDate";
    parameters[1].Value = System.DateTime.Now.AddHours(-6).ToString();
    parameters[2] = new ReportExecutionWS.ParameterValue();
    parameters[2].Name = "Resolution";
    parameters[2].Value = "180";
    // We dont need to pass read-only parameters!!!
    //parameters[3] = new ReportExecutionWS.ParameterValue();
    //parameters[3].Name = "ParentId";
    //parameters[3].Value = string.Empty;
 
 

Remote Differential Compression – Vista highs and lows

Its like finding one of Windows Vista’s Holy Grails!
 
In my first post I talked about the length of time it takes to solve some technological problems and this is another of those great gotcha’s! I have been using Vista (32 & 64 bit flavours) since they were issued as Beta versions and have been very pleased with it. I agree, its very hardware intensive but as an overall package I like it and I continue to work with it on my 2Gb RAM laptop Smile every day. However, there has been one particular issue that has been driving me round the proverbial bend on both my 32-bit laptop and my 64-bit desktop.
 
Moving and copying files from one machine to another has been difficult, impossible and sometimes worse. There can be nothing more frustrating than wanting to do a simple drag-n-drop file copy from one machine to another in my home network and Vista just sits there. It claims to be working out how long this task is going to be taking, but don’t you belive it, this task will never happen! It used to work, once, a long time ago and I am not exactly sure what stopped it working altogether but I did the usual thing and trawled the net for a solution.
 
The Register (http://www.theregister.co.uk/2007/08/29/vista_networking_degradation/) has a great article about this with some useful links and from here I have finally found a solution that seems to work. Turn off Remote Differential Compression. Not sure why this has been causing so many problems but this has worked for me. I now see progress bars zipping accross the screen as files are transfered at the expected rate.
 
If you are not sure how to turn off Remote Differential Compression in Vista go to the Programs And Features section under the Control Panel and select Turn Windows features on or off. In the box that comes up deselect the Remote Differential Compression feature.
 
 rdc
 
If you want to know more about Remote Differential Compression take a look here.
 
Update – March 2008 : Windows Vista SP1
 
I have just applied the new release of Service Pack 1 for Vista on both my Desktop and Laptop and tried transfering a 450 MB file from my desktop to my laptop using the wireless router….SmileSmileSmile…. the problem seems to be fixed…at least in this scenario. There was no long delay whilst Windows ‘Calculated the time remaining…’ or any problem transfering the file. I will keep doing some tests over the next few days, but hopefully this will mean the end to one of Vista’ biggest annoyances!