Skip to content

Instantly share code, notes, and snippets.

View NickPl's full-sized avatar
😎

Nick Plourde NickPl

😎
  • @Pr0gmat1c
  • Montreal
View GitHub Profile
# This script was intended for Dynamics CRM 2016 on-premise.
function Get-Users {
<#
.SYNOPSIS
Retrieve dynamics system users domain name.
.DESCRIPTION
Retrieve dynamics system users domain name.
.PARAMETER ServerUrl
The server url and the organization
@NickPl
NickPl / xrmutil.js
Last active December 10, 2018 19:10
Utility Javascript class for Dynamics CRM 2016
/* jshint unused: false */
/* globals Xrm */
var XrmUtil = (function () {
// Private / Global var
var odataEndPoint = Xrm.Page.context.getClientUrl() + '/api/data/v8.2/';
// Private / Global function
var ErrorHandler = function (e, origin) {
try {
@NickPl
NickPl / DualXrmServiceContext.cs
Created February 8, 2018 03:32
Blog XrmMtl - Essential Plugin Class for Early Bound
using <GeneratedEntities>;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xrm.Plugins.Sandbox
@NickPl
NickPl / Plugin.cs
Last active December 10, 2018 19:21
Blog XrmMtl - Essential Plugin base class
namespace Xrm.Plugins.Sandbox
{
using Microsoft.Xrm.Sdk;
using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.ServiceModel;
using System.ComponentModel.Design;
@NickPl
NickPl / autorefresh_dashboard.html
Last active January 30, 2018 01:10
Blog XrmMtl - How to automatically refresh a dashboard
<html>
<head>
<script type='text/javascript>
setInterval(function() {
parent.Mscrm.DashboardRibbonActions.refreshDashboardPage();
},60 * 1000);
</script>
</head>
</html>
@NickPl
NickPl / sample.js
Created January 28, 2018 22:39
Blog XrmMtl - CRM 2016 – Update lookup field bug
//Create the lookup value object
var lookupReference = [];
lookupReference[0] = {};
lookupReference[0].id = “{a0c68c89-9752-e311-93f9-00155d78043f}”;
lookupReference[0].entityType = “new_entityname”;
lookupReference[0].name = “Display name”;
//Magic happens here
lookupReference[0].type = “lookup”;
@NickPl
NickPl / sample.js
Created January 28, 2018 04:45
Blog XrmMtl - Update lookup field bug
//Create the lookup value object
var lookupReference = [];
lookupReference[0] = {};
lookupReference[0].id = "{a0c68c89-9752-e311-93f9-00155d78043f}";
lookupReference[0].entityType = "new_entityname";
lookupReference[0].name = "Display name";
//Magic happens here
lookupReference[0].type = "lookup";
@NickPl
NickPl / sample.js
Created January 28, 2018 04:19
Blog XrmMtl - Phone Call: blank notification
function OnLoad() {
if (!window.parent.$('span#Notification0_text').text()) {
var notificationId = window.parent.$('div#Notification0').attr('notificationid');
Xrm.Page.ui.clearFormNotification(notificationId);
if (Xrm.Page.context.getUserLcid() == 1036) {
Xrm.Page.ui.setFormNotification('Au moins un destinataire est marqué "Ne pas autoriser" les appels téléphoniques', 'ERROR');
}
else {
Xrm.Page.ui.setFormNotification('At least one recipient is marked as "Do Not Allow" phone.', 'ERROR');
@NickPl
NickPl / devenv.ps1
Last active April 19, 2021 20:36
BoxStarter DevEnv Beta
Update-ExecutionPolicy Unrestricted
#iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NickPl/boxstarter/master/BuildScripts/bootstrapper.ps1'))
#Get-Boxstarter -Force
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force;
`iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
cinst pwsh -y