Posts

Showing posts from August, 2026

Everyday Dynamics 365 Form JavaScript: Read-Only Fields, Lookup Filters, Autocomplete and Metadata

Alongside the Web API series, this blog has carried a handful of very short posts over the years — a code snippet, a sentence of explanation, and not much else. Individually they were notes I wrote so I would not have to work the same thing out twice. Together they cover something more useful: the small pieces of JavaScript and metadata plumbing you end up needing on almost every Dynamics 365 form. I have merged five of those posts into this one, kept the code exactly as it worked, and added the context that was missing the first time round: when to use each one, what breaks, and what has changed now that Xrm.Page is deprecated. 1. Make every field on a form read-only This comes up whenever a record reaches a state where it should be locked — an approved order, a closed case, a submitted application. Rather than disabling forty fields one at a time in business rules, walk the controls collection and disable everything. function makeFieldsReadOnly() { var controls = Xrm....

Dynamics 365 Web API: The Complete CRUD, FetchXML and Actions Reference

Between 2018 and 2022 I published a series of short posts on this blog, each covering one Dynamics 365 Web API operation: create, retrieve, update, delete, associate, disassociate, calling actions. They were written as notes to myself while working on real implementations, and over the years they became the posts people landed on most often. The problem with that format is that nobody works on one operation in isolation. When you write JavaScript for a Dynamics 365 form you usually need three or four of these at once, and jumping between ten browser tabs to copy each helper is a poor way to spend an afternoon. So I have merged the whole series into this single reference, corrected a couple of mistakes that were in the original snippets, added the missing helper function they all quietly depended on, and brought the guidance up to date for Dynamics 365 in 2026. Everything below is code I have actually used in production environments. Where something is now deprecated I have said so and ...