web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Layoutxml

(0) ShareShare
ReportReport
Posted on by

Hi Friends,

Can some one suggest me how to get LayoutXml from Advanced find by clicking source F12???

Thanks and Regards,

*This post is locked for comments

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    What do you mean by layoutxml ?? what is your requirement ??

  • Suggested answer
    Community Member Profile Picture
    on at

    Are you trying to get the fetchXML? if yes, while you are on the query builder screen, you can click download fetch xml to get the XML. If no, please explain your requirement.

  • Raghuveer Profile Picture
    on at

    Hi Mahen,

    I added a ribbon button to connect button drop down on organisations form and now i am trying to default the lookup view to show related entity.

    So i am writing a java script to default the lookup view.

    I need Fetch Xml and Layout Xml to use in my JS.

    I got the Fetch Xml for Advanced find.

  • Raghuveer Profile Picture
    on at

    function setFilterSampleLookup()

    {

    var viewId = Xrm.Page.getControl("Sample").getDefaultView();

    var entityName = "Sample";

    var viewDisplayName = "Sample";

    var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +

     "<entity name='Sample'>" +

       "<attribute name='Sample' />" +

       "<attribute name='Sample' />" +

       "<attribute name='createdon' />" +

       "<order attribute='Sample' descending='false' />" +

       "<filter type='and'>" +

         "<condition attribute='statecode' operator='eq' value='0' />" +

       "</filter>" +

     "</entity>" +

    "</fetch>";

    var layoutXml = "<grid name='resultset' object='10116' jump='hbs_name' select='1' icon='1' preview='1'><row name='result' id='hbs_activityclassificationid'><cell name='hbs_name' width='300' /><cell name='createdon' width='125' /></row></grid>";

    document.getElementById("Sample").setAttribute("defaulttype", "10116");

    document.getElementById("Sample").setAttribute("lookuptypes", "10116");

    Xrm.Page.getControl("Sample").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

    document.getElementById("Sample").disableViewPicker = 1;

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    You don't need any layoutxml to setup filter lookup view, you can simply use set filter like this: blogs.msdn.com/.../addpresearch-and-addcustomfilter-in-crm-2013.aspx

    In case you looking for old approach there we used to do before (but not sure why you are looking for that), you can refer: crmdm.blogspot.ae/.../lookup-filtering-in-crm-2011-using.html

    Thanks

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Raghuveer,

    After reading the comments i found that you want to filter the lookup values based on FetchXml Query . I Too had a same requirement in my project work.

    I have written a blog on this :

    crmpankaj.blogspot.in/.../crm-2015-javascript-lookup-filtering.html

    Hope this would solve your problem

  • Raghuveer Profile Picture
    on at

    Thanks guys!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans