D365 Quick Tip: Getting layoutXml from DevTools

Most times when you want to use AddCustomView() method to a Dynamics 365 control, you need to pass layoutXml to the method that will show the view you define.

There’s an easier trick than writing this up.

Select your View

Assuming, you have an Advanced Find view open in the window which you want as a layoutXml of, on the same, press F12 to open Dev Tools. Select the selector.

And on the Advanced Find window, select Body section
Click on it, and the par will be selected in the Console of the Dev Tools.

Once this is available, search for layoutXml and cycle through the results to go to the last result.

select the “value” part. That is your layoutXml. Hope this helps.