locked
CRM 2015 Hiding fields in the form Header RRS feed

  • Question

  • Hi,

    I am using the below code to hide the field in the header of the form, but it is throwing me error as it is unable to find the control, though the control is present on the header. is it possible to hide the field in the header?

    Xrm.Page.getControl("header_ownerid").setVisible(true);


    Regards

    Jeevan




    Regards Jeevan Please vote for me if you find the answer is useful.

    Friday, October 2, 2015 8:28 AM

All replies

  • did you try just

    Xrm.Page.getControl("ownerid").setVisible(false);


    My blog: www.crmanswers.net - CRM Theme Generator

    Friday, October 2, 2015 8:35 AM
  • This code will work fine if i have to hide the field on the form, my requirement is to hide the field on the header.So it is not working.

    Regards Jeevan Please vote for me if you find the answer is useful. 



    • Edited by Jeevan264 Friday, October 2, 2015 9:00 AM
    Friday, October 2, 2015 8:59 AM
  • I just tried with your code inside a CRM 2015 instance

    Xrm.Page.getControl("header_ownerid").setVisible(false);

    and it works


    My blog: www.crmanswers.net - CRM Theme Generator

    Friday, October 2, 2015 9:04 AM
  • I played with the script and found something interesting, if the header has more than 4 fields on it, the script is not working. So it only works if there are only 4 fields on the header.

    Regards Jeevan Please vote for me if you find the answer is useful.

    Friday, October 2, 2015 2:37 PM
  • I played with the script and found something interesting, if the header has more than 4 fields on it, the script is not working. So it only works if there are only 4 fields on the header.
    I believe Guido's reply answers your question (so please go and mark it as an answer and helpful as it is written in your sign) and if code doesn't work when there are more then 4 fields in header it's a bug and only MS can help you to resolve it.

    Dynamics CRM MVP
    My blog

    Saturday, October 3, 2015 9:48 AM
    Moderator