Recently when digging into the PU18 updates in D365FO I found a bug in the audit trail page located at System Administration -> Security Configuration -> Selecting a security layer -> Audit Trail. This functionality is used to compare different versions of a security layer to see what has been added, removed, or stayed the same between those versions.
When trying to access the page in one of the newer platform updates, you will receive an error:
“Cannot execute a data definition language command on Security object events view (SecurityObjectEventView). Unable to create a view in the database. This can be caused by missing metadata (data source)…”
If we look in the AOT for the SecurityObjectEventView, we can verify that indeed it is a system view with no data source in the metadata.
So by trying to use this view as a data source on this form without that view having an underlying data source is why you get this error.
This issue will have to be fixed by Microsoft as there really isn’t a workaround as you can no longer over layer (or in this case even extend) the object.
After some trail and error, I found that you can copy the contents of the underlying data source table of this view (SecurityObjectEvent) to a custom table and then use that as a data source for a form. Using this method you are able to create reports on security design changes like the one below.