Hy everyone, how are you?.
Well. The case is that I need to develop a web resource that will be embeded on Form’s header.
This Web Resource should draw a rectanble with a label for each value of a pick list that is being showed on the form.
I tryed to use HTML 5 in order to draw the rectangles but I can’t make it work properly once is included on the web resource.
I’ll paste here an excample that, if it’s opened normally using IE, runs normally, but opened through a Web resource embeded into the form’s header down’t work and throws me an exception like : ‘ getContext(() functions is not defined’
Here is the code
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var xpos = -50;
debugger;
for (var ii = 0; ii < 3; ii++) {
xpos += 50;
ctx.fillStyle = "#FF0000";
ctx.fillRect(xpos, 1, 50, 50);
ctx.fillStyle = "#000000";
ctx.font = "10px Arial";
ctx.fillText("Stage ", xpos+5, 25);
}
Question: Can I draw in crm using HTML 5 into a web resource????
Thanks in advance!
I’m sorry to say that but the answer marked as the correct one it’s not actually correct cause doesn’t answer the question and also got me into confusion because of an assumption.
Nobody’s fault, however lets say things straight for the other who will need the right answer to this question.
The error you received sounds like this: “Object doesn’t support property or method ‘getContext'” and referrs to HTML5 canvas.getContext() object.You got this error because the built-in object for the canvas element, the getContext() one, works only in IE9 (first IE browser version compatible with HTML5) and you runed your CRM 2011 instance in an older version of IE.
Seeing this message on my computer I thought this is an error cause I was running my CRM 2011 instance in IE9 browser version but when I runned the F12 developer tools in I saw that the Browser Mode was IE9 but the Document Mode was IE8 standards wich is set as the default one for the CRM 2011 instance. So, I tried to change it to IE9 standards but surprise – CRM 2011 has now javascript errors and crushes. Looks like CRM 2011 doesn’t actualy runs in IE9 standards but in IE8 standards even if the browser version is IE9 (bropably this was your case too).
So, for the moment, using HTML 5 elements into Html Web Resource in Crm 2011 is not yet possible.
The only ideea I have in mind is that for the moment we can only create stand alone appplications that can contain HTML5 elements and connects to our CRM data till MS figures out a way for running CRM 2011 in IE9 standards.
If somebody knows more than those informations, please let us know.
Sry for the possible typos!