Execute Web API request using Angular JS in Dynamics CRM

Execute Web API request using Angular JS in Dynamics CRM  #MSDyn365 #webapi

  • In our earlier blogs of  Web API introduced in Dynamics CRM 2016, we have explained different requests and functions of Web API to querying and performing operations in Dynamics CRM.
  • This blog will show you how to execute Web API request using Angular JS.
  • So, we can use “$http” service to execute Web API request.
  • Below is the code snippet that query Dynamics CRM data,

    In this code, we have passed Web API query to select top 3 accounts.

  • Here, the only difference between above code and the code that executes Web API function is URL and headers.

Introduction In our earlier blogs of Web API introduced in Dynamics CRM 2016, we have explained different requests and functions of Web API to querying and

@inogic: Execute Web API request using Angular JS in Dynamics CRM #MSDyn365 #webapi

In our earlier blogs of  Web API introduced in Dynamics CRM 2016, we have explained different requests and functions of Web API to querying and performing operations in Dynamics CRM.

This blog will show you how to execute Web API request using Angular JS.

This article would be helpful for those who have knowledge of Angular JS and now want to know how to use Angular JS to perform operations in Dynamic CRM.

Angular JS provides in-built service “$http” that facilitates communication with the remote HTTP servers via XMLHttpRequest object or via JSONP. In JQuery, $.ajax is used for same purpose.

So, we can use “$http” service to execute Web API request.

Below is the code snippet that executes Web API function:

You can see that, we pass Web API request to retrieve version of Dynamics CRM to URL. Execute “RetrieveVersion()” function, similarly you can execute other Web API functions like “WhoAmI()”, ”GetDefaultPriceLevelRequest()”, etc.

Below is the code snippet that query Dynamics CRM data,

In this code, we have passed Web API query to select top 3 accounts. Here, the only difference between above code and the code that executes Web API function is URL and headers.

Conclusion:

If you are developing an application for Dynamics CRM using Angular JS, we can use $http service to get Dynamics CRM data or perform operations in Dynamics CRM.

Completed  with Dynamics CRM implementation? Whats next? Monitor User Adoption!

Inogic is one of the most renowned Microsoft ISV with a Gold competency in Microsoft Dynamics CRM ecosystem. Inogic is a hub of innovation, and cutting-edge technologies delivering innovative services and solutions like Maplytics™, one of the first geo-analytical mapping solutions to be Certified for Microsoft Dynamics (CfMD) & InoLink: QuickBooks Integration, to CRM Customers and Partners alike.

Execute Web API request using Angular JS in Dynamics CRM

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.