Pages

Monday, March 26, 2012

Web Resource Utility use case

In light of my previous post, I thought I'd give a use case for the Web Resource Utility.

In CRM 4.0 we implemented a customization for contacts such that an image of the contact would be present on the contact form. This was done by referencing files on the file server. Although it's possible to do it the same way in 2011 a better approach is to have the contact images stored as web resources (for example, ease of access for remote users).

The question therefore was how to go about uploading all the files from the file server as web resources. Doing it manually would take way too long... Enter the Web Resource Utility.

Basically, all that is necessary is to point the Web Resource Utility to the folder containing the image files and click upload. Well, at least in theory...

One of the issues faced was that the image files contained spaces in them and the Web Resource Utility did not accept spaces...


One option would be to update the source code of the Web Resource Utility as we of course have access to that. Another option, would be to manipulate the files to remove the spaces using a file multi-renaming tool such as the one shown to replace all cases of " " with "_" (underscore).


And subsequently the files can be uploaded using the Web Resource Utility -

One other slightly painful feature of the Web Resource Utility is the presence of the leading "/" for the imported file names.



Once again, the source code could be updated to remove this but for the time being I've decided to live with this as is. The end result is that we have managed to bulk upload hundreds of images without breaking a sweat.



No comments:

Post a Comment