This is one of those very cool and incredibly useful tips you will want to make a note of.
One of the things that I had to do quite recently, was to change the view that were available to an entity in the GridView. Well, it is just a query afterall, so lets start by going to the Advanced Find button at the top of the page.
Now, Click the <Find> button to return the results...
Go ahead and build yourself a query. In this case, I want to view all accounts that have activities which are open (dont ask me why, it's a long story). When you are finished, you should have something like this...
Now for the fun bit. Press the F11 Key twice to pop out of Application Mode and paste the following piece of javascript into the resulting URL bar.
javascript:void( new function() { var s=""; function f(p){ s+= p + "=" + eval("advFind." + p) + "\n\n" };f("FetchXml");f("LayoutXml");f("EntityName");f("QueryId");f("QueryObjectType");alert(s) } )
Or this....
javascript:alert(resultRender.FetchXml.value);
But by using the 'prompt' command, this is better...
javascript:prompt("my query:", resultRender.FetchXml.value);
Or even this...
Javascript:void( alert( document.getElementsByName("fetchxml")[0].value ))
When you hit <enter> you will see the following popup...
This will work for any query. The Advanced Find dialogue is pretty powerful and you can design quite intricate queries with it, but the best of the lot is that you get to see the actual code being output. This lends itself to being embedded in your custom webpages or external websites.
Finally, this can be used to build custom lookups....
Nice post on crm configuration.... I was looking for this from 2 weeks... very informative stuff..
Posted by: MS CRM Implementation | July 31, 2008 at 07:03 AM