Giter Site home page Giter Site logo

crm-dynamics-angular-service's Introduction

crm-dynamics-angular-service

Access CRM Rest and soap services using AngularJs

There are three main things which could be injected using the angular dependency injection.

  • crmRestSvc : make calls to crm server using the rest protocole
  • crmSoapSvc : make calls to crm server using the soap protocole
  • crmCommon : common functions shared by the above services
angular.
module("appModule", ["crmModule"]). // bring in the Crm Module
controller("MyController", ["crmRestSvc", // bring in the Crm Rest Service
  function (crmRestSvc) {
    var that = this;
    crmRestSvc.retrieveMultiple("Account", { $select : "Name,Telephone1", $top : 10 })
      .then(function (accounts){
        that.accounts = accounts;
      });
 }
])

crmRestSvc

retrieveMultiple

Retrives multiple records from CRM

  crmRestSvc.retrieveMultiple("Account", { $select : "Name,Telephone1", $top : 10 })
  .then(function (accounts){
  // use accounts
  }, function (errors){
  // something went wrong
  })

retrieve

Retrieve single record from CRM

  crmRestSvc.retrieve("Contact", "{eee1c358-06ca-4ee3-afad-ddfb45a473e5}")
  .then(function(contact){
  // use contact
  })

Additional options could also be passed to the retrieve function

  // will fetch the contact only with fullname.
  crmRestSvc.retrieve("Contact", "{eee1c358-06ca-4ee3-afad-ddfb45a473e5}" , { $select : "FullName" })
  .then(function(contact){
  // use contact
  })

create

Creates a new record in CRM. Pass the schema name of the entity and the entity as an object.

crmRestSvc.create("Contact", { FirstName : "John", LastName : "Doe" });

update

crmRestSvc.update("Contact", "{eee1c358-06ca-4ee3-afad-ddfb45a473e5}", { FirstName : "John", LastName : "Doe" });

remove

crmRestSvc.remove("Contact", "{eee1c358-06ca-4ee3-afad-ddfb45a473e5}");

delete

Same as remove. This might not work in older browsers because delete is a reserved word so use the remove method instead.

associate

crmRestSvc.associate(accountId,	"Account", "Referencedaccount_parent_account", childId, "Account");

disassociate

crmRestSvc.disassociate(accountId, "Account", "Referencedaccount_parent_account", childId);

crm-dynamics-angular-service's People

Contributors

prabhjots avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.