Skip to content

Instantly share code, notes, and snippets.

View AccountForm.js
function openDialog(exectionContext) {
var dialogParameters = {
pageType: "custom",
name: "new_dialogsample_bb2dc",
};
var navigationOptions = {
target: 2,//use 1 if you want to open page inline or 2 to open it as dialog
width: 800, // value specified in pixel
height: 420,
position: 1,//1 to locate dialog in center and 2 to locate it on the side,
View index.ts
import { IInputs, IOutputs } from "./generated/ManifestTypes";
export class ValueTurner implements ComponentFramework.StandardControl<IInputs, IOutputs> {
private context_: ComponentFramework.Context<IInputs>
constructor() {
}
/**
View ControlManifest.Input.xml
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
<control namespace="MEA" constructor="ValueTurner" version="1.0.21" display-name-key="ValueTurner" description-key="ValueTurner description" control-type="standard" >
<external-service-usage enabled="false">
</external-service-usage>
<property name="data" display-name-key="data" description-key="data" of-type="Object" usage="input" required="true" />
<property name="sessionStorageKey" display-name-key="sessionStorageKey" description-key="sessionStorageKey" of-type="SingleLine.Text" usage="input" required="true" />
<resources>
<code path="index.ts" order="1"/>
@melamriD365
melamriD365 / loadModernPanel.js
Last active Jul 14, 2021
First look at the multi-tab panel (sidePanes)
View loadModernPanel.js
if (typeof (MEA) == "undefined") { MEA = {} };
if (typeof (MEA.Apps) == "undefined") { MEA.Apps = {} };
if (typeof (MEA.Apps.RD) == "undefined") { MEA.Apps.RD = {} };
MEA.Apps.RD = {
onLoad: async function () {
//Xrm.Panel.loadPanel("WebResources/mea_/Webpages/Youtube.html", "Panel 1");
var sidePanes = Xrm.App.sidePanes;
sidePanes.state = 0
@melamriD365
melamriD365 / FlowWidgetSPA.html
Last active Aug 3, 2021
Integrate the approval center into a model driven app/Dynamics 365 CE
View FlowWidgetSPA.html
<html>
<head>
<title>Flow JS SDK Sample</title>
<style>
.flowContainer iframe {
border: none;
width: 100%;
height: 100%;
}
@melamriD365
melamriD365 / getDataverseToolsForCrmDeveloperTools.ps1
Created Jun 13, 2021
get Dataverse Tools For CrmDeveloperTools
View getDataverseToolsForCrmDeveloperTools.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = ".\nuget.exe"
Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe -Scope Global -Verbose
##
##Download Plug-in Registration tool
##
@melamriD365
melamriD365 / OpportunityCloseQuickCreateForm.js
Created Jun 8, 2021
Modify the labels of the Opportunity Close Quick Create form dynamically according to the context of the opportunity closure.
View OpportunityCloseQuickCreateForm.js
function onLoad(executionContext){
var formContext = executionContext.getFormContext();
var pageContext = Xrm.Utility.getPageContext();
var isWon = pageContext.input.data.param_won;
if(isWon) formContext.getControl('actualend').setLabel('Win date');
else formContext.getControl('actualend').setLabel('Lose date');
}
@melamriD365
melamriD365 / sampleConsoleApp.cs
Created Jun 2, 2021
Dataverse Sample ConsoleApp Client (oAuth2.0)
View sampleConsoleApp.cs
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;
using System;
namespace MEA
{
class sampleConsoleApp
@melamriD365
melamriD365 / AccountForm.js
Created Jun 1, 2021
Cancel save based on the result of async operation (Example 2)
View AccountForm.js
if (typeof (MEA) == "undefined") { MEA = {} };
if (typeof (MEA.Account) == "undefined") { MEA.Account = {} };
if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} };
MEA.Account.AccountForm = {
onLoad: function (executionContext) {
var formContext = executionContext.getFormContext();
formContext.data.entity.addOnSave(
(() => {
var asyncSaveValidation = (saveCtx) => {
@melamriD365
melamriD365 / AccountForm.js
Last active Jun 1, 2021
Cancel save based on the result of async operation (Example 1)
View AccountForm.js
if (typeof (MEA) == "undefined") { MEA = {} };
if (typeof (MEA.Account) == "undefined") { MEA.Account = {} };
if (typeof (MEA.Account.AccountForm) == "undefined") { MEA.Account.AccountForm = {} };
MEA.Account.AccountForm = {
onLoad: function (executionContext) {
var formContext = executionContext.getFormContext();
formContext.data.entity.addOnSave(
(() => {
var asyncSaveValidation = (saveCtx) => {