I had to use this code again and found some users were receiving “Access Denied” errors – as reported in comments to this post. Looks like this is due to a bug in certain versions of IE.
The fix is available here… http://support.microsoft.com/kb/2601307/en-us?sd=rss&spid=15672
Had a requirement to show an image that has been attached through the notes system on a CRM form. Here’s how it’s done:-
To retrieve the image data, I use Daniel Cai’s excellent CRM Web Service Toolkit which still works beautifully in CRM 2011. A simple fetchXML query to retrieve the documentbody from the annotation entity against the related objectid is all it takes.
IE8 onwards appears to support display of inline images under various encoding methods (including Base 64). The syntax is:-
</pre> <img src="data:image/jpg;base64,IMAGEDATA" alt="" /> <pre>
So here’s the finished JavaScript:-
function form_onload() { var id = Xrm.Page.data.entity.getId(); var fetchXml = [ "", "", "", "", "", "", "", "", "", "", "", ""].join(""); var fetchData = CrmServiceToolkit.Fetch(fetchXml); if (fetchData.length == 0) { return; } var img = fetchData[0].getValue('documentbody'); var el = document.getElementById("IFRAME_image"); if (!el) { return; } img = "</pre> <img src="\"data:image/jpg;base64,"" alt="" /> <pre>"; el.contentWindow.document.body.innerHTML = img; }
Hope that helps someone out!
Helena Barbosa
/ July 18, 2011HI
Thanks for your sharing! Very good
Sometimes it works and sometimes not: same record and same image sometimes it shows and sometimes not! it appears “error 404 Resource not found”
I think the problems is time to load the image , howver the size is nera 40k.
How can I avoid the error message?
Regards
Helena
petecrm2011
/ July 18, 2011Helena,
That’s a weird problem.
You could try switching the query to run asynchronously…
var fetchData;
function form_onload() {
var id = ...;
var fetchXml = ...;
fetchData = CrmServiceToolkit.Fetch(fetchXml, fetchCallBack);
}
function fetchCallBack(fetchData) {
if (fetchData.length == 0) { alert ("No image data received"); }
var img = fetchData[0].getValue('documentbody');
var el = document.getElementById("IFRAME_image");
if (!el) { alert("Iframe not found"); }
img = "";
el.contentWindow.document.body.innerHTML = img;
}
(Code untested).
Let me know if that makes it work any better.
Robert
/ May 25, 2012Onload event generates “Error:Access is denied” even though I have System Admin role.
re-manufactured ink cartridge
/ February 12, 2013Hey there! I know this is somewhat off topic but I was wondering which blog platform are you using for this website?
I’m getting tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.
www.cashyes.com
/ March 14, 2013Fine way of explaining, and nice article to take information
concerning my presentation subject matter, which i am going to present in college.
http://qwickfanz.com/instagram_followers.html
/ March 16, 2013Heya this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if you
have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!
click the up coming website page
/ March 20, 2013It’s wonderful that you are getting ideas from this piece of writing as well as from our argument made at this place.
Norman
/ March 21, 2013Si vous appréciez marches ou balades à vélo,
vous pourrez parcourir le réseau de chemins de randonnées ou de petites routes peu passantes, au départ de la
maison. Vous pourrez en une heure ou deux à pied accéder
à la grotte des huguenots, une tombe antique creusée dans
la pierre, l’Eglise, la tour de guet avec sa vue à 360°,
ou encore le volcan de Chirouze. Nous tenons à votre disposition les cartes et guides
de la région et pourrons vous conseiller en fonction de vos désirs.
Pour découvrir la région en voiture, vous vous rendrez à Privas en 15
minutes, Aubenas en 30 minutes, Antraigues en 45
minutes, Vallon Pont d’Arc en 1 heure, Le Mont
Gerbier de Jonc en 1 heure et 15 minutes. Pour les gourmands de produits du terroir
vous trouverez à Privas : marrons glacés Clément Faugier,
charcuterie (caillettes, jambons, saucissons séchés en montagne), fromages de chèvres (les fameux
picodons), côtes du Rhône rouges ( Syrah, Merlot, …), et blancs (Chardonnay,
Viognier, …)
http://veerle-v2.duoh.com/blog/comments/spraying_symbols_in_adobe_illustrator
/ March 22, 2013My family all the time say that I am killing my time here at net,
but I know I am getting experience every day by reading
thes fastidious articles.
Roseanne
/ March 27, 2013Thanks to my father who told me concerning this web site,
this web site is in fact awesome.
web design magazine
/ March 29, 2013Hello friends, its impressive paragraph about tutoringand fully explained, keep it up all the time.
Detox Max Plus Ingredients
/ March 29, 2013Hey There. I found your blog using msn. This is a very well
written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will certainly comeback.
Dale
/ April 26, 2013I’ve been exploring for a little for any high quality articles or blog posts in this sort of house . Exploring in Yahoo I finally stumbled upon this site. Studying this info So i’m happy to
convey that I have an incredibly good uncanny feeling I
found out exactly what I needed. I such a lot undoubtedly will make certain to don?
t forget this web site and give it a glance regularly.
paphos car hire
/ April 27, 2013You need to check as many paphos car hire associations as possible for the holiday-lovers to migrate from
one place to another clearly an area with less Verizon juice.
Altinfiyatlari.me
/ April 30, 2013After I originally commented I appear to have clicked
on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the
same comment. Perhaps there is a means you are able to
remove me from that service? Thanks!
Kathryn
/ April 30, 2013I appeciate this discussion here on Showing an attached image on
a CRM form (pure javascript) IE8+ only | Pete’s CRM 2011 Stuff. We are in OC|an Orange County realty.
Maxine
/ May 1, 2013In need of an earpiece for work and came across this site,
it really is so confusing, all i know is that i would like a sepura
earpiece, your article post has helped but i need to
investigate somewhat more!
search engines
/ May 2, 2013I was recommended this web site by my cousin. I am not certain whether or not this submit is written by means of him as
no one else recognise such distinctive approximately my difficulty.
You’re incredible! Thanks!
Contact Us
/ May 2, 2013Aw, this was a very good post. Taking the time and actual effort to make a very good article… but
what can I say… I put things off a lot and never seem to get
nearly anything done.
world of warcraft gudies
/ May 8, 2013Thankfulness to my father who stated to me regarding this web site,
this webpage is truly remarkable.
symptoms of piles
/ May 9, 2013Hi, just wanted to mention, I liked this article.
It was practical. Keep on posting!
Earlene
/ May 12, 2013I usually do not respond to messages, but on this case. WoW!
‘
best places to meet women
/ May 17, 2013May I simply say what a comfort to discover an individual who genuinely understands what they are discussing on the web.
You certainly realize how to bring a problem to light and
make it important. A lot more people really need to
check this out and understand this side of the
story. I can’t believe you are not more popular given that you certainly have the gift.
http://www.techassistnj.com/
/ May 18, 2013Hey There. I found your blog using msn. This is an extremely well
written article. I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly return.
Stanley
/ May 25, 2013To tak naprawdę perfekcyjny oraz pomocny kawałek wiadomości.
Jestem szczęśliwa, że trafiłam na Twój materiał. Dzięki za udostępnienie.
tvxqpowerfullgods.blogspot.com
/ May 31, 2013Shoppers can save up to 70 mph. Positive effects of farmacia on line;
70 to 85 percent of men, these two markets alone could make PT-141 a pharmaceutical blockbuster.
Well, still very recognizably” Motorola” about the fungus harvest, said in a press release Tuesday.
Maurine
/ June 4, 2013Heya i am for the primary time here. I came across this board and
I to find It truly useful & it helped me out a
lot. I hope to provide something back and aid others such as you aided me.
Pregnancy Yoga Oxford
/ June 5, 2013I hardly write comments, but i did a few searching and wound up here
Showing an attached image on a CRM form (pure javascript) IE8+ only
| Pete’s CRM 2011 Stuff. And I actually do have a few questions for you if you usually do not mind. Is it only me or does it seem like a few of these remarks look like they are written by brain dead individuals? 😛 And, if you are posting on additional social sites, I’d like to keep up with anything new you
have to post. Would you make a list of the complete
urls of all your communal pages like your linkedin profile, Facebook page or twitter feed?
lose weight
/ June 6, 2013Hey there are using WordPress for your site platform?
I’m new to the blog world but I’m trying to get started and set up my own.
Do you need any coding expertise to make your own blog? Any help would be really appreciated!
www.hnefatafl.info
/ June 12, 2013Woah! I’m really digging the template/theme of this website. It’s simple, yet effective.
A lot of times it’s very hard to get that “perfect balance” between usability and visual appeal. I must say that you’ve done a excellent job with this.
Additionally, the blog loads very quick for me on Safari.
Exceptional Blog!
Burclar.Ws
/ June 12, 2013I like the helpful information you supply on your articles.
I’ll bookmark your weblog and test once more right here regularly. I’m reasonably certain I’ll be informed lots of new stuff proper right here! Best of luck for the next!
Angel
/ June 13, 2013I’m curious to find out what blog platform you’re using?
I’m experiencing some minor security issues with my latest website and I would like to find something more risk-free. Do you have any recommendations?
http://triumphantwarriors.ning.com/
/ June 15, 2013Greetings from Florida! I’m bored to death at work so I decided to check out your blog on my iphone during lunch break. I love the knowledge you provide here and can’t wait
to take a look when I get home. I’m amazed at how fast your blog loaded on my phone .. I’m not even using WIFI, just 3G .
. Anyhow, wonderful blog!
alexander events
/ June 20, 2013Take Satisfaction In Your Cat By Following These Sturdy Suggestions.
Cats are wonderful property creatures. If you’ll hold the opportunity to’t
be as aspect of your respective property all time of evening, cats can dwell on
their very individual. The next details will support you to
discover all about cats.
Within the celebration the holiday season rolls all roughly, safeguard
your Xmas tree from curious kitties. It might see that tree and climb it.
That could be an big difficulty. Will certainly not permit your dog dog to prowl all-round your tree.
It’s possible you’ll have to also be certain that
you are able to arrive throughout no loose garlands, ornaments or tinsel that is feasible for being eaten using the cat.
Really actually will not have your cat carry a med if they’re not suffering out of one’s wellbeing concern it totally was designed to treat.
Numerous of individuals flea medications you fit on your cat also cope
with for parasites, mites and also other illnesses that your cat will not have and can not contract.
Though these medications are prosperous on highway cats, they might be seriously not vital for
indoor cats.
The location with all the litter field is important.
Your extremely 1st
rid black skin
/ June 25, 2013My partner and I stumbled over here by a different website and thought I should check things
out. I like what I see so now i am following you. Look forward to checking out your web page yet again.
Augustus
/ June 28, 2013Hello there, I discovered your site by means of Google even as looking for a related matter,
your site got here up, it appears to be like good.
I have bookmarked it in my google bookmarks.
Hello there, simply became aware of your weblog through Google, and located that it is really informative.
I am gonna be careful for brussels. I will appreciate when you proceed this
in future. Many other people shall be benefited out of your writing.
Cheers!
Issac
/ July 14, 2013In many cases, the amount of place that you are purchasing the
childrens beds for play and make clear it is an area for sleep,
not amusement. At MOM’S safety comes first, so all of our childrens beds are strongly constructed and rigorously tested in independent labs to meet or exceed both ASTM and CSPC safety standards. This prevents any kind of risks.
Insurance Claim Jobs
/ July 16, 2013I all the time used to read paragraph in news papers but now as I am a
user of web so from now I am using net for articles or reviews, thanks to web.
Earle
/ July 22, 2013Dentist is the most difficult to deal with childrens beds operate
done at a private clinic. There are basically three ways of getting free childrens beds.
Smoking is very bad for all aspects of root canal therapy including routine as well as being
certified by the International Congress of Oral Implantology as well
as practice management and community outreach. 99% bacteria
that 01% is an elusive bugger, preventing cavities, and bad breath.
safest place to buy instagram followers
/ August 7, 2013Hello my family member! I want to say that this post is awesome, great written and
include approximately all significant infos.
I would like to look more posts like this .
diet hormones
/ June 28, 2014You could definitely see your expertise in the article you write.
The sector hopes for even more passionate writers such as
you who are not afraid to mention how they believe.
At all times go after your heart.
topappguide.com
/ July 17, 2014It’s truly very difficult in this full of activity life to listen news on Television, so I only use world wide web for that reason, and get the newest information.
seins naturels videos
/ September 23, 2014I’m curious to find out what blog platform you are utilizing?
I’m experiencing some small security problems
with my latest blog and I’d like to find something more
safe. Do you have any suggestions?
sunnyside bar
/ September 30, 2014I’m very pleased to find this site. I want to to thank you for
ones time for this fantastic read!! I definitely liked
every bit of it and I have you saved to fav to check out new things on your web site.
早漏改善
/ October 28, 2016エッチの際に発射のが早い人を早漏といいます。しかし早漏でなければ男優は務まらないといわれるほどなので、じつは早漏自体は悪ではありません。大切なのは発射を操れるようになることです。必要とあらば1分以内に発射することもできるし、長くエッチを楽しみたいときは1時間でも挿入していられる。そのように訓練していくことが大切です。早漏には自律神経が関係していて、発射の指示を出すのは交感神経です。日頃の姿勢などによって自律神経を意図的にコントロールすることも不可能ではありません。遅漏など男性器4大トラブルの改善に役立つ方法をご紹介します。
Ingrid
/ December 30, 2016However, he was still busy with a movie that was in the
middle of production at the time the first pilot was to be shot.