Skip to content

Instantly share code, notes, and snippets.

View justlikemichel's full-sized avatar

Michel justlikemichel

View GitHub Profile
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Collections.Generic;
namespace MichelOverrideExampleApp
{
public class MichelOverrideExampleHookImplementation : Microsoft.Xrm.Tooling.Connector.IOverrideAuthHookWrapper
{
// In memory cache of access tokens
Dictionary<string, AuthenticationResult> accessTokens = new Dictionary<string, Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult>();
##
##Target
##
cd $Env:userprofile
md .\Dynamics365\
cd Dynamics365
##
## Wire up NuGet
/// <reference path="../MSXRMTOOLS.Xrm.Page.2016.js" />
// Declaring our Namespace
var MindsUnitedCourse = MindsUnitedCourse || {};
MindsUnitedCourse.WebApi = (function () {
// Helper method for calling the WebApi
function _callWebApi(method, collection, querystring, postData, successCallBack, errorCallBack) {
// Get the client Url
// Helper method for calling the WebApi
function callWebApi(method, collection, querystring, postData, successCallBack, errorCallBack) {
// Get the client Url
var clientUrl = Xrm.Page.context.getClientUrl(),
// Create a XMLHttpRequest
request = new XMLHttpRequest();
// Build the request using the provided collection and querystring
request.open(method, clientUrl + "/api/data/v8.1/" + collection + (querystring || ""), true);