By default in CRM when you open up a Lead, Contact, Account or any other form for that matter, the dimensions of the windows are 1012 pixels wide, by 611 pixels high, and the position of the window is 124 pixels in from the left of the screen, and 170 pixels down from the top of the screen. These pre-set dimensions work fine until you have too many fields to fit on the tab, and the annoying vertical scroll bar appears.
- Navigate to Settings, Customization, Customize Entities and then locate and open the entity you wish to change the dimensions of.
For this blog I will be changing the dimensions of the Contact form.
- Click on Forms and Views and open up the main Form view.
- Click on Form Properties, select OnLoad, and then click Edit.
- Make sure the Event is enabled check box is checked, and then paste in the following code into the OnLoad event.
- Change the numbers above to alter the size of the window. Where 1012 is the default width, and 611 is the default height.
- After changing the height and width of the window you may find that the positioning of the window now needs changing as well. To change the positioning of the window paste the following code below the last line of code in the OnChange event.
- Change the numbers above to alter the positioning of the window. Where 124 is the default distance between the window and the left of the screen, and 170 is the default distance between the window and the top of the screen. It should look something like this:
- Click OK twice to close the OnLoad event, and Form Properties windows.
- Save and Close the Form, and then Publish your changes.
NOTE: If you Preview the Create Form the positioning of the window will be different to the positioning of the actual window when published. So it is best to publish it and check the changes properly.
If the dimensions aren’t exactly right you can just open the OnChange event again and modify the dimensions until it looks how you want it.
When the window is opening your changed dimensions won’t take effect until it has fully loaded the window, so while you’re trying to get the dimensions exact you can compare the window sizes and positions to make sure they are exactly what you require.
In the image below the Contact form is customized to 1000px wide by 500px high, and the position of the window is 100px from the top and left of the page.