web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Change Account form Header Title value

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to change account form header value only in display. In header title account primary attribute value is display that is name. But I want to display other custom attribute value.

We are using CRM 2016, I know there is a method available for access header fields Xrm.Page.setControl("header_name"). But this update name attribute in record that I don't want. I want to update only in display.

please help me.

 

Thanks,

Vaib

*This post is locked for comments

I have the same question (0)
  • Tim Dutcher Profile Picture
    2,100 on at

    You can use the setSubmitMode function, with "never" as the parameter, to avoid saving back the changed value.

  • Community Member Profile Picture
    on at

    Hi Tim,

    Thanks for quick reply.  Actually after update header_name field value this reflect on account name field in the header not on form Header Title. I want to change form Header Title . In the form title it will reflect after save.

    Can you suggest any other approach for update title.

    Thanks,

    vaib

  • Suggested answer
    Tushar2016CRM Profile Picture
    1,130 on at

    HI

    Please check the below link if it helps .

    crmxpg.nl/.../change-form-title-in-ms-crm-via-javascript

    Thanks !

  • Community Member Profile Picture
    on at

    Hi Tushar,

    In CRM 2016, all the support of JS code like getelementbyID or getelementbyTagName has removed. So we can not use this.

    Previously on crm 2013 , we used this code but this will not work on CRM 2016 with new form rendering method.

    For this work, I need to use legacy form setting that I cannot do. Because new rendering method are very good for form load performance.

    Thanks,

    vaib

  • Suggested answer
    Hemant Kumar Sahu Profile Picture
    1,829 on at

    Hi

    This may help you

    stackoverflow.com/.../crm-2011-2013-stopping-header-displaying-new-contact-or-new-property-etc

    Regards

    Hemant Kumar

  • awalters Profile Picture
    3,079 on at

    That link still uses getElementById, which as they've pointed out above, is no longer supported.

  • Suggested answer
    MehrCrm Profile Picture
    290 on at

    In 2016, you can access any element on the form using the window.parent.document.all collection. In the following example, I have registered "FormOnLoadHandler" function on the form onload event;

    function FormOnloadHandler(context) {
        // Timer is needed as not all elements may have been added to the document.all collection
        // may need to adjust the timer duration
        setTimeout(function () {
            console.log("Form loaded. Changing title....");
            var allelem = window.parent.document.all;
            console.log("All elements length " + allelem.length);
            for (var i = 0; i < allelem.length; i++) {
                var id = allelem[i].id || allelem[i].getAttribute('id');
                if (id == 'FormTitle') {
                    // H1 element where title is displayed
                    allelem[i].childNodes[0].innerText = "My New Title is Displaying";
                    break;
                }
            }
        }, 1000);
    }

    If this answers your question, please mark as answered.

  • Community Member Profile Picture
    on at

    Hi MehrCrm,

    Thanks for reply. I tried your suggested code , but it does not worked. It does not generate any error but also does not set header title.

    Thanks,

    vaib01

  • Verified answer
    MehrCrm Profile Picture
    290 on at

    Hi vaib01,

    I did test the code (IE, Chrome, and FF) in 2016 with turbo forms turned on. A couple of questions.

    In browser console (F12), Do you see the messages "Form loaded. Changing title...." and "All elements length " being displayed?

    Did you increase the timer duration from 1000 (1 sec) to say 2000 (2 sec) to see if it works?

    If you place "console.log(id);" after the "var id = allelem[i].id || allelem[i].getAttribute('id');" line, do you see the ids of DOM elements being printed to the browser console?

    Thanks

  • Community Member Profile Picture
    on at

    Thanks MehrCrm,

    I have increased time duration to 2 second and this is working.

    Thanks,

    Vaib01

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans