Answered by:
CRM 2011: Setting document.title in CRM 2011 doesn't work for me

Question
-
In CRM 4 I had code in a form onload event to change the form's title, among other things, depending on the current record's status, type, etc. It used to simply be something like:
document.title = 'STATUS TEXT HERE - ' + document.title;
The current value of document.title is what was expected but changing it in a form's onload doesn't work for me in CRM 2011. I don't see anything regarding document.title and CRM 2011 when searching. Has anyone else noticed this? Any ideas what needs to be done differently?
FYI: I can still change the title text within the form with something like the following code:
function addTitlePrefix(prefix) { var titleSpan = document.getElementById('form_title_div'); if(titleSpan) { for(var i = 0;i < titleSpan.children.length;i++) { if(titleSpan.children[i].className == 'ms-crm-Form-Title-Data autoellipsis') { titleSpan.children[i].innerText = prefix + titleSpan.children[i].innerText; } } } }
Thanks!
Monday, May 9, 2011 2:49 PM
Answers
-
I am sorry but this is not a supported customization and the new page model for CRM 2011 locks a lot of these things down so that they are harder to do also.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Bill Faulk Monday, May 9, 2011 3:53 PM
Monday, May 9, 2011 3:48 PMModerator
All replies
-
I am sorry but this is not a supported customization and the new page model for CRM 2011 locks a lot of these things down so that they are harder to do also.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked as answer by Bill Faulk Monday, May 9, 2011 3:53 PM
Monday, May 9, 2011 3:48 PMModerator -
Thanks! That's what I figured but I just wanted to make sure I wasn't missing anything.Monday, May 9, 2011 3:53 PM
-
I needed to do this to, and here's how I got it to work in the form_Onload
parent.document.title = "Set Title Value";
- Proposed as answer by ChrisH5491 Friday, November 11, 2011 4:39 PM
Friday, November 11, 2011 4:39 PM -
This is still not supported. I also notice an underscore in your "form_Onload". Did you modify your aspx page manually? This would be really REALLY unsupported.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Friday, November 11, 2011 5:22 PMModerator -
This is still not supported. I also notice an underscore in your "form_Onload". Did you modify your aspx page manually? This would be really REALLY unsupported.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Try this make help you.
document.getElementById("form_title_div").childNodes[2].childNodes[0].innerText ="Some string";
- Proposed as answer by Kiran Madhav Monday, July 2, 2012 9:43 AM
Monday, July 2, 2012 9:43 AM -
You can change the CRM form title on Form onload By using javascript function
You have to include firstly Jquery as web resource.
and call this function on form onload event
function changelabel() {
var title= $(".ms-crm-Form-Title-Label");
if (title != null) {
title[0].innerHTML = "MY CUSTOM TITLE";
}
}- Proposed as answer by Bharti Sujanian Saturday, December 22, 2012 7:47 AM
Saturday, December 22, 2012 7:39 AM