During the wrapping up of my required fields series, I wrote a custom plugin to solve the problem that CDS simply doesn’t solve in a safe way – I’ve open sourced that code if you decide you would also like to use it.
How to configure the solution
- Boot up XrmToolBox. If you haven’t heard of XrmToolBox – check it out then track back to me once you’re done!
- Get the “Plugin Registration” tool from the library if you don’t already have it and open it – connecting to your org instance at the same time.
3. In your list of plugins, somewhere you will see
MBeard.CDSSystemRequiredFields listed. Find it and click the “+” icon to expand.
4. Right click on the (Plugin) line and click “Register New Step”
5. Set the follow pieces of data.
Message: "Create" Primary Entity: "account" (or whichever entity) Eventing Pipeline Stage of Execution: "Pre-validation".
6. Click “Register New Step”. Rinse and repeat for any other entity type.
You’re done – give it a go. Try and save a record with a missing required field and you should see the error message.