2

I am experimenting with CRM Word Templates, which for the most part seem pretty straight forward, except when it comes to PictureContentControls. Every tutorial I've seen for CRM Word Templates looks pretty much the same and says to only select Plain Text or Picture controls on your template.

The problem I'm having is that I'm unable to get a CRM image to display in the Picture control. I've tried adding a User profile picture to a SystemUser record, and I have a SystemUser template - I see fields for entityimage, entityimage_timestamp, entityimage_url, and entityimageid, of which I've tried creating a Picture control for entityimage and entityimage_url. Each time I get an error when I try to export the Word Template from a User.

I know the database schema for storing that image is a little weird, so to have more control I've also tried creating a signature field (Pen control), which ends up saving the image of a signature directly to the field in the database like this:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...

Although obviously, much longer. I tried mapping that field to the Word Template Picture control and also get an error - I checked the event viewer and it says that it isn't a valid base64 string. I've tried adjusting the string a few times (removing the data:image/png;base64,) but still get the same error. The moral of the story is that I have no idea what format data needs to be in, in order to populate this Picture control, and there doesn't seem to be any good documentation on it either (at least for CRM). Any help is appreciated!

Goose
  • 3,241
  • 4
  • 25
  • 37
  • I do not have dynamics-crm, but I tried mapping a picture content control to an XML Element, inserting a .jpg, then examining the XML of the saved file. The Element contained a base64 representation of the .jpg, and nothing else. So I would guess that dynamics-crm must do that conversion for you for database columns that it "understands". Maybe just storing what you have but omitting the "data:image/png;base64," part would be enough? –  May 28 '16 at 00:59
  • Thanks for the comment, but I've already stated above that I tried removing that part of the string and received the same error. – Goose May 31 '16 at 16:33
  • My bad. Obvious question: is the rest of the string definitely a valid base64 string, i.e. is it only Word that complains about it? What error(s) do you get - do they offer any clues at all, or are they just "invalid XML at line 5000" type messages? –  May 31 '16 at 18:26
  • The only error is that it is not a valid base64 string, but I have validated the string value and it is in fact a valid base64 string, so I'm guessing there may be an underlying error that is just being masked by this one. – Goose May 31 '16 at 21:04

0 Answers0