Where is my Layout XML?

I’m writing this mainly because it gets asked so much and in some cases the newbies are trying to figure out where on earth am I going to get the Layout XML to add a custom view or modify the lookup to use a different view.

Here is a quick way of accomplishing this.

Problem:

Want to create a Layout XML string to be used in JavaScript on a form. Most of us know how to obtain the FetchXML using Advanced Find. that’s easy breezy.

Solution:

  1. Create an empty solution and add the Entity in question which you are trying to change. If you are querying deep and want to display related records field values.
  2. Create a Personal View with the required layout. Save and Publish.
  3. Export this solution as an UNMANAGED Solution. Save the ZIP file.
  4. Unzip the solution file.
  5. Open customization.xml file using Notepad++ and under SavedQueries node for the entity in question, look for the Personal View you created using Name.
  6. Viola, you will see the LayoutXML and FetchXML.

Happy Customization.

Advertisements