The Silverlight CRM Attachment Image leverages the REST End Point to provide a simple way to add a changable image to a CRM 2011 form/entity using a Silverlight application. The image is stored in the notes, leveragin core CRM.
Currently this project is still in the making. If you have any suggestions on how to make it better, I'm open to suggestions.
How to add the Attachment Image Silverlight control
Please follow these steps:
- Upload the xap as a web-resource
- Create a text-field that is not searchable to store the annotationid (guid)
- Add the Web-Resource to the form
- Check the checkbox to pass the id and type, etc.
- In the parameters add the fields and their values seperated by a pipe |
- Example: field=new_imageattachmentid|subject='Contact''s Image'|prefix='img-'
- Available fields are:
- field - The name of the field you are using to store the annotationid of the attachment. It is required, and the field
MUST BE ON THE FORM (it does not need to be visible).
- subject - The subject for attachments - the following substitutions are available
- %s - The name of the file
- prefix - The prefix for all attachment images (this is used to filter the results, etc)
- hidebuttons - Used to hide the buttons that are in the silverlight control so that you can use the ribbon to control the application
- savefirst - Used to set the message that is displayed on a form that is in Create Mode
- webcam - Set to true if you want to enable the webcam it is not currently tide to hidebuttons
- max-width- maximum width for all images
- max-height - maximum height for all images
- max-webcam-width - maximum webcam image width, overrides max-width for web-cam images
- max-webcam-height - maximum webcam image height, overrides max-height for web-cam images
- Currently there is not an example of the ribbon integration - once created & tested it will be included.
- Add a resize option so that all uploaded images are decreased to a specified width or height.
The delete button does not delete the image from the attachments it only unlinks it, clearing the ID. If you want it to delte the note, that could be done with a little bit more code in the Delete method.
Thanks to some of the comments (WalterN & NAG) that have helped me fix some of the bugs I was not seeing in my initial debugging and testing.