Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Hiding a Form Field Label in MSCRM 3.0

    Posted on February 12th, 2006 mitch Print Print 2 comments

    As you know, CRM automatically adds a field label/description to any field on the data entry form ( as shown below ): 

    Normal text field edit box

    Occasionally, I have run into the requirement to hide the field label.  This is easily done by unchecking the Display label on the form property of the field:

    Normal text field edit box 

    Unfortunately, this produces what I think is an undesirable result:

    Want I really want is to have the actual edit field to remain where it was originally, lined up with the other edit fields.  So, how do we get around this functionality?  With a little ingenuity and JavaScript, of course.

    Add the following line to the Form's OnLoad event:

    crmForm.all.[fieldname]_c.style.color = "#EEF0F6";

    All field labels are named exactly like the data entry fields, but with a "_c" appended to the end of the name.

    In this example, we are changing the color of the text of the field label to match the Form's background color. This will, in effect, "hide" the label from the user, while keeping the form layout the same.  Here is how it will actually look:

    Pretty cool, huh? 

    NOTE: I found the color information used in this example by reviewing the sample stylesheet that is included with the CRM 3.0 SDK.

     

    Update (2/18/06):

    Ryan Farley has a great article that shows a similar technique for hiding an entire field.

    Customization, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    4,561 views
  • Improper Thought of the Day

    Posted on February 12th, 2006 mitch Print Print No comments

    So I'm making meat balls in Marinara sauce for lunch.  As I'm loading up the Crock Pot with frozen meat balls and sauce, the following thought pops into my head:

    Man, you could put someone's eye out with one of these.

    I honestly have no idea how I come up with these things sometimes…

     

    Meanderings
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    747 views