Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
Coding @ Maldives Beaches

Ashish Vishwakarma AshV

🌴
Coding @ Maldives Beaches
View GitHub Profile
View DownloadAllDynamics365EmailAttachments.html
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.2/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js"></script>
</head>
<body>
<button onclick="getAttachmentList()">Download All Attachmenta</button>
View GetValuesWithFieldLevelSecurity.cs
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using System;
using System.Activities;
namespace WordCountWorkflow
{
public class WordCount : CodeActivity
{
[Output("phone")]
View PrePlugin.cs
using Microsoft.Xrm.Sdk;
using System;
namespace Plugin
{
public class TestPlugin : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
var tracing = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
View CustomWorkflowDynamics365.cs
public class WF : CodeActivity
{
[RequiredArgument]
[Input("Code")]
public InArgument<string> Code { get; set; }
[Output("Custom Team")]
[ReferenceTarget("team")]
public OutArgument<EntityReference> CustomTeam { get; set; }
View azure-speech.html
<html>
<head>
<title>Speech SDK JavaScript Quickstart</title>
</head>
<body>
<!-- UI code goes here -->
<div id="warning">
<h1 style="font-weight:500;">Speech Recognition Speech SDK not found (microsoft.cognitiveservices.speech.sdk.bundle.js missing).</h1>
</div>
View firebase-realtime-db.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script src="https://www.gstatic.com/firebasejs/6.1.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.1.1/firebase-database.js"></script>
<script>
var firebaseConfig = {
@AshV
AshV / JsonNullHandling.cs
Last active Feb 5, 2019
Remove null properties while serializing JSON using Newtonsoft.Json
View JsonNullHandling.cs
using Newtonsoft.Json;
JsonConvert.SerializeObject(
<your Object to be serialized>,
Newtonsoft.Json.Formatting.None,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
}));
@AshV
AshV / email.json
Last active Dec 24, 2018
Email with CRM records available or without(directly using email Id) | Microsoft Dynamics 365 Sample
View email.json
{
"regardingobjectid_contact@odata.bind": "/contacts(<regarding contact record guid>)",
"subject": "Email Subject",
"description": "Email Description",
"email_activity_parties": [
{
"partyid_systemuser@odata.bind": "/systemusers(<from system user record guid>)",
"participationtypemask": 1
},
{
@AshV
AshV / Microsoft-Dynamics-365-Server-2-Server-Authentication-Access-Token.cs
Created Dec 17, 2018
Microsoft-Dynamics-365-Server-2-Server-Authentication-Access-Token.cs
View Microsoft-Dynamics-365-Server-2-Server-Authentication-Access-Token.cs
/// Required-Namespaces
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Threading.Tasks;
/// Method-to-generate-Access-Token
public static async Task<string> AccessTokenGenerator()
{
string clientId = "Azure AD App Id";
string clientSecret = "Client Secret Generated for App";
string authority = "https://login.microsoftonline.com/< your app tenant guid >";
View ParseCustomerJourneyWorkflow.js
Xrm.WebApi.retrieveRecord(
"msdyncrm_customerjourney",
"945a02a0-b2db-e811-a967-000d3af29269",
"$select=msdyncrm_workflowdefinition").then(
function (result) {
debugger;
console.log(result);
var workflowdefinition = JSON.parse(result.msdyncrm_workflowdefinition);
// Retrieve nodes related to provided component.