Banner

Retrieve CRM Data From API

Back to Blog Listing


Data can be retrieved from the Dynamics CRM API using the .retrieve function once a connection to the iOrganizationService has been established. The format of the retrieve function is as follows:

retrieve([Entity Name], [Entity GUID], [Entity Column Set])

e.g.

ser.Retrieve("contact", new Guid(ContactID), new ColumnSet("contactid", "firstname", "lastname", "emailaddress1"))

 

The "Entity Name" is simply the name of the entity that you wish to retrieve as named in CRM. If you are unsure as to what this is then check the name of the entity within the "customize the system" section of the CRM web interface.

The "Entity GUID" is simply the GUID for the entity that you wish to return. for more information on how to retrieve the GUID of an entity from the web interface please see - http://www.c2software.com/c2-blog/return-crm-guid.aspx

The "Entity Column Set" is a list of each of the attributes that you wish to retrieve. You can use "True" as a parameter rather than a list of string and this would return all columns but this is not advised. Using "True" is the equivalent of using "Select * From" in SQL. It will take longer for the query to return and will bring back more data than you require. Instead a list of string values should be used. The string values should relate to the attribute names in the CRM (these can be checked and found within the "customize the system" section of the CRM web interface for each entity). Please note that the attribute names should also always be in lower case.



29 Sep 2014

About the Author

James CTwo is our blogging alter ego for the Dynamics CRM and Web experts here at C2. We have a passion for anything CRM, Web Design or Social Media. We love writing about it! Find us on YouTube & Twitter.

comments powered by Disqus

Our White Papers

"Discover the content that matters to you on business transformation. Explore how you can drive customer engagement, empower your team, optimise your businesses and revolutionise your products with the next digital revolution. For more information visit our white paper library."

Library

C2 Newsletter

Our newsletter is sent on a quarterly basis, offering detailed insights into all aspects of business transformation with Microsoft cloud technologies. We also promote upcoming events and special offers throughout the year. Sign up to get involved today.

Dynamics 365 Office 365 Power BI Silver Partner