Announcements
No record found.
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
What do you mean by layoutxml ?? what is your requirement ??
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.
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.
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='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;
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
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
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.