When Level Up isn’t installed… you are.

These expressions can be pasted into the browser developer console if you are unable to use browser extensions such as Level Up. Access the web browser console via F12 for Edge.
| Purpose | Snippet |
|---|---|
| Show the schema / logical name for columns/fields on the form | Xrm.Page.data.entity.attributes.forEach(function (attribute, index) {let control = Xrm.Page.getControl(attribute.getName()); |
| Unlock any locked columns/fields on the form | Xrm.Page.data.entity.attributes.forEach(function (attribute, index) { let control = Xrm.Page.getControl(attribute.getName()); if (control) { control.setDisabled(false) } }); |
| Set all tabs to visible | Xrm.Page.data._formContext.ui.tabs.forEach(function(tab,index){ |
| Get record Id | Xrm.Page.data.entity.getId();Popup: alert(Xrm.Page.data.entity.getId()) |
| Make all fields optional | Xrm.Page.data.entity.attributes.forEach(attr => { attr.setRequiredLevel('none'); }); |
| Show hidden columns/fields | Xrm.Page.ui.controls.forEach(c => { if (!c.getVisible()) c.setVisible(true); }); |
