Skip to content

Instantly share code, notes, and snippets.

@alirobe
Last active February 25, 2020 09:18
Show Gist options
  • Save alirobe/456d7a30023eaf087359e37806325326 to your computer and use it in GitHub Desktop.
Save alirobe/456d7a30023eaf087359e37806325326 to your computer and use it in GitHub Desktop.
Reduce Dynamics 365 v9 Field Spacing
if(!window.parent.document.querySelector('style#v9removepadding')) {
var style = window.parent.document.createElement('style');
style.id = "v9removepadding";
style.innerText = ".acwallEmailView .emailexpandedaccordion { margin:0; width:100% } TABLE.ms-crm-FormSection td { padding: 4px 1px 1px 16px !important; min-height: 26px; }";
window.parent.document.body.appendChild(style);
}
@alirobe
Copy link
Author

alirobe commented Mar 7, 2018

how to apply: (CRM admin only)

  1. Add as a settings -> customization - > web resource. (It's a JScript.)
  2. Publish the resource
  3. Add the webresource to entity -> form -> properties -> form libraries, for forms where you want to reduce padding...
  4. Publish the forms

note; this won't be supported by myself or microsoft - remember to leave a link to this gist in the description of the web resource, then add the webresource to forms where you want to apply this style...

Important known bugs:

  • the way this works currently, once it is applied on any form, it will continue to apply on all subsequent forms loaded in the same browser session. PR to fix this is welcome (potentially hook to url#target change?)
  • lookups still cause weirdness

@hshill1ng
Copy link

Awesome, Alirobe!!! You rock!

@alirobe
Copy link
Author

alirobe commented Feb 25, 2020

Thanks for the feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment