Skip to content

Instantly share code, notes, and snippets.

View AshV's full-sized avatar
🌴
Coding @ Maldives Beaches

Ashish Vishwakarma AshV

🌴
Coding @ Maldives Beaches
View GitHub Profile
@AshV
AshV / gist:a9d34b040dc94c91549b6a4d7ee6a2ac
Created July 13, 2023 06:20
Creating an Audit Report for User Logins in Dynamics CRM
https://www.concurrency.com/blog/march-2016/creating-an-audit-report-for-user-logins-in-dynami
@AshV
AshV / gist:750cca9b205d6c6dccc88e7c7eb71328
Created July 12, 2023 09:51
Find when some particular field value was changed for few specific records
TBD
@AshV
AshV / fetchXml-CurrentUserTeams.xml
Created June 6, 2023 07:13
FetchXml query to list all Owner Teams where Current/LoggedIn user is a member.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="team">
<attribute name="name" />
<attribute name="teamid" />
<filter type="and">
<condition attribute="teamtype" operator="ne" value="1" />
</filter>
<link-entity name="teammembership" from="teamid" to="teamid" visible="false" intersect="true">
<link-entity name="systemuser" from="systemuserid" to="systemuserid" alias="ae">
<filter type="and">
/RetrieveTotalRecordCount(EntityNames=['account','contact','systemuser'])
@AshV
AshV / fetchXml-ListAllCloudFlowsWithSolution.xml
Created April 12, 2023 21:43
FetchXml query to list out all cloud flows in an environment along with solutions where they are added
<fetch>
<entity name="solutioncomponent">
<link-entity name="solution" to="solutionid" from="solutionid" alias="solution" link-type="inner">
<attribute name="solutionid"/>
<attribute name="friendlyname"/>
</link-entity>
<link-entity name="workflow" to="objectid" from="workflowid" alias="flow" link-type="inner">
<attribute name="workflowid"/>
<attribute name="name"/>
<filter>
@AshV
AshV / fetchXml-CurrentUserAssignedRoles.xml
Last active April 12, 2023 22:16
FetchXml query to list all Security Roles assigned to Current/LoggedIn user.
<fetch>
<entity name="systemuser">
<filter>
<condition attribute="systemuserid" operator="eq-userid"/>
</filter>
<link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
<link-entity name="role" from="roleid" to="roleid" alias="AssignedRole">
<attribute name="name"/>
</link-entity>
</link-entity>
@AshV
AshV / FetchXML.md
Created March 27, 2023 14:55 — forked from jdthorpe/FetchXML.md
Notes on FetchXML

Learn to Love Tolerate FetchXML

Overview

FetchXML seems to be a quirky subset of the SQL implemented in XML and optimized for UI tasks, including:

  • the ability select specific fields (foo, b.bar) or all fields (*) from an entity
  • perform LEFT OUTER and INNER joins
  • assign aliases to attributes (select a.b as foo) and (joined) entities (left join foo as BAR)
<!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>
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using System;
using System.Activities;
namespace WordCountWorkflow
{
public class WordCount : CodeActivity
{
[Output("phone")]
using Microsoft.Xrm.Sdk;
using System;
namespace Plugin
{
public class TestPlugin : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
var tracing = (ITracingService)serviceProvider.GetService(typeof(ITracingService));