Retrieve the records using FetchXML is a convenient way as we can form the FetchXML easily using the ‘Advanced Find’ .
Download Fetch XML
Once you have the FetchXML ready, below is the JScript to execute and read the result set.
In this sample, I am fetching records from custom entity “Bikes” which has relationship with ‘Contact’ entity. (i.e., Fetch all the bikes of a Contact whose full name contains ‘Raj’)
Note – I am using “xrmservicetoolkit” helper Jscript which is available in CodePlex. You just need to download the Jscript and refer to your CRM form.
One response to “Retrieve records with Fetchxml using Jscript – CRM 2011”
Bob
Thank you. I used this for a similar thing to get the Business Unit name of someone given their Full Name.
The trick is to change the alias in the link-alias tag of the Fetch query. When you download it gives a unique identifier. In my case, I changed it simply to “bu”.
Leave a comment