Posts

Implementing and Registering Dataverse Plugins: Create Message End-to-End Guide

Implementing and Registering Dataverse Plugins: Create Message End-to-End Guide Server-side logic in Dataverse runs when specific events occur. Plugins let you inject custom behavior during these events. This section covers how to compile plugin code, register it, connect it to a trigger, and validate its execution. Compile the Plugin Assembly Your plugin must be compiled into a DLL before Dataverse can run it. In Visual Studio, use Rebuild on your project. After a successful build, open the project’s output folder and locate the DLL inside bin\Debug . // Example: Locate compiled plugin DLL ProjectFolder\bin\Debug\YourPluginAssembly.dll Connect to Dataverse Environment Use the Plugin Registration Tool inside XrmToolBox. Launch the Connection Wizard, enter your organization URL, and authenticate. Set a highlight color for the environment to avoid deploying to the wrong system. Register the new assembly by selecting ...

Implementing Plugin Logic in Dataverse

Implementing Plugin Logic in Dataverse – Create Message Dataverse plugins allow you to execute server-side logic in response to platform events such as Create , Update , or Delete . This section focuses on implementing logic for the Create message, where data can be validated, enriched, or controlled before or after it is saved to the database. The Create message is triggered when a new record is saved in Dataverse. Plugins registered on this message are commonly used for enforcing business rules, setting default values, or creating related records automatically. Accessing the Target Entity The core of plugin logic begins with the Target entity. This object contains the attributes entered by the user during record creation. Defensive checks are mandatory to avoid runtime failures. if(context.InputParameters.ContainsKey("Target") || context.InputParameters["Target...

Plugin Project Structure and Coding Foundation

Plugin Project Structure and Coding Foundation With the development environment and tools ready, the next step is to organize your project files so you can begin writing plugin logic that Dynamics CRM will accept and run. Project Creation and Naming In Visual Studio, create a new project using the Class Library (.NET Framework) template. Use a clear naming pattern such as CompanyName.Plugins.EntityName. For example, a plugin for the Account table could be named LS.Plugins.AccountPlugins. Make sure the project targets .NET Framework 4.6.2, as this is required for compatibility with Dynamics CRM. Signing the Assembly Before a plugin can be registered in CRM, its assembly must be signed with a strong name key. In Visual Studio, open the project properties and go to the Signing tab. Check Sign the assembly, then create a new key file such as key.snk. For simplicity during development, you can choose to ...

Plugin Development Workflow: Registration, Deployment, and Validation Tools

Plugin Development Workflow: Registration, Deployment, and Validation Tools After completing the initial Visual Studio setup for plugin development, the next phase focuses on registering and validating plugin logic inside Dataverse. Writing code alone is not enough. The assembly must be deployed correctly and its behavior verified in the Dynamics interface. XrmToolBox – Deployment and Registration XrmToolBox is a community-maintained Windows application used extensively in Dynamics CRM and Dataverse development. It provides a collection of tools for managing environments, metadata, and custom components. The tool is distributed as a ZIP file and does not require installation. Extract it into a local directory under your user profile. Avoid placing it in cloud-synced folders such as OneDrive to prevent file locking issues. After launching XrmToolBox, use the Connection Wizard to authenticate and conn...

XrmToolBox & FetchXML Builder – Complete Setup Guide (Dataverse)

XrmToolBox & FetchXML Builder – Complete Setup Guide (Dataverse) XrmToolBox is a community-driven Windows application that hosts a collection of tools for managing and customizing Microsoft Dataverse environments. One of its most powerful extensions is FetchXML Builder, which enables crafting, testing, and validating FetchXML queries without writing code manually. Installing XrmToolBox Download the latest XrmToolBox release from the official source and extract the application to a folder on your system. XrmToolBox runs as a standalone executable and does not require an installer. After extraction, launch XrmToolBox. On first run, the application may prompt to install community plugins. You can skip this initially if you want to install only specific tools later. Connecting to Dataverse In XrmToolBox, open the connection dialog and choose the appropriate organization from your Dataverse enviro...

Preparing the Development Setup for Model-Driven App Plugins

Preparing the Development Setup for Model-Driven App Plugins Setting up the development environment for Model-Driven App plugins requires strict alignment with Microsoft Dataverse requirements. The environment must be configured exactly as specified; any deviation results in unsupported code that fails at registration or runtime. Choosing the Correct IDE Plugin development must be done using Visual Studio . Visual Studio Code is not sufficient because plugins depend on the full .NET Framework and project templates that VS Code does not provide. While installing Visual Studio, select the .NET desktop development workload. This ensures that all necessary build tools, compilers, and templates for .NET Framework class libraries are installed. Installing the Supported .NET Framework After selecting the workload, go to the Individual components tab in the Visual Studio Installer. Microsoft Dataverse ...

Plugins in Dynamics CRM and Model-Driven Apps

Plugins in Dynamics CRM and Model-Driven Apps In Dynamics CRM and Model-Driven Apps, plugins are custom code components used to extend platform behavior. They allow developers to enforce business rules, manipulate data, and integrate external systems. Both platforms operate on the same underlying data layer known as Microsoft Dataverse. Dataverse stores all information as tables, including business records such as accounts and contacts, as well as system-level components like forms and views. Plugins attach logic to these tables by responding to messages generated during data operations. How Plugins Work: The Messaging Pipeline Whenever a user performs an action—such as saving a record—the data is packaged into a structure called the Target and sent to Dataverse. This action generates a message like Create or Update . That message then moves through a predefined execution pipeline. Plugins can be registered at ...

Dataverse Actions – Complete Guide (Model-Driven Apps)

Image
Dataverse Actions – Complete Guide (Model-Driven Apps) Dataverse Actions are a powerful feature in Microsoft Dataverse that allow you to execute custom business logic directly from model-driven apps, Power Automate, or external systems. Actions are typically used when you want to perform an operation that goes beyond simple create, update, or delete actions on a table. What are Dataverse Actions? A Dataverse Action represents a reusable business operation. It can accept input parameters, perform logic, and return output values. Unlike workflows or plugins that automatically trigger, actions are explicitly invoked by users or automation. In model-driven apps, actions are commonly exposed as command bar buttons, allowing users to trigger business logic manually from a form or grid. Types of Dataverse Actions Bound Actions – These actions are associated with a specific Dataverse table. They operate...

Use Power Fx in Power Pages (Preview)

Image
Use Power Fx in Power Pages (Preview) Power Fx is the low-code language used across the Microsoft Power Platform to express business logic. It is a general-purpose, strongly typed, declarative, and functional programming language. Power Fx is written in human-friendly text and is designed to be authored directly by makers using an Excel-like formula bar. Its concise syntax makes it easy for both citizen developers and professional developers to build dynamic behavior. Note: Power Fx syntax in Power Pages requires formulas to begin with an equals sign (=), similar to Excel. This syntax might differ from what you are used to in Power Apps or Power Automate. Power Fx enables collaboration across no-code, low-code, and pro-code teams by allowing logic to be written in a consistent and readable manner. Important: This is a preview feature. Preview features are not intended for production use and m...

Tutorial: Add a Custom Page Layout in Power Pages

Image
Tutorial: Add Custom Page Layout to Your Power Pages Site When you create new webpages using the Pages workspace in Power Pages, you can choose from predefined page layouts. In some scenarios, you may want to create a custom page layout to display information in a specific format or provide a specialized user interface. In this tutorial, we create a custom page layout using Liquid . The example demonstrates a two-column layout with the main site menu on the left and page content on the right. What We Will Build Create a common base web template with custom layout code Create a second web template that extends the base template Create a page template referencing the web template Create a web page using the custom page layout Prerequisites A Power Pages subscription or trial An existing Power Pages site Basic knowledge of HTML and Liquid Step 1: Create a Web Template and Wri...

Exercise: Display a List of Accounts Using Liquid in Power Pages

Image
Exercise: Display a List of Accounts Using Liquid in Power Pages In this hands-on lab, you learn how to access Dataverse data using Liquid code. The goal of this exercise is to: • Enter Liquid code as page content • Access Dataverse data using Liquid • Use conditional statements to display available data You will create a page that lists active accounts and shows the total number of accounts. Step 1: Open Power Pages Design Studio Sign in to Power Pages and open the website you want to edit. Step 2: Create the Suppliers Webpage In the Pages workspace, select + Page, enter "Suppliers" as the page name, choose the blank template, and add the page. Step 3: Add HTML and Liquid Code On the Suppliers page, add a text component and replace its placeholder with the following HTML and Liquid: <h2>Lis...

Power Pages Liquid – Basics

Image
Liquid Basics in Power Pages Learn how Liquid syntax, filters, and tags work in Power Pages. Liquid is a templating language recognizable by two sets of delimiters: {{ }} for output and {% %} for logic and control flow. Output Statements Output statements display values from objects or text inside double braces. Hello {{ user.firstname }} from {{ 'Power Pages' }} If the current user’s first name is Doug, this would produce: Hello Doug from Power Pages This demonstrates how static text and dynamic values combine. Using Filters Filters modify output values. They are added using the pipe (|) symbol. Hello {{ user.firstname | upcase }} from {{ 'Power Pages' }}. The date is {{ 'now' | date: 'MMMM d yyyy' }} This example uses the upcase filter to convert text to uppercas...

Using Liquid in Power Pages – Step by Step guide

Image
Using Liquid in Power Pages – Step by Step Learn how to add a simple Liquid expression to a Power Pages site. Example Used The following Liquid expression displays the current time dynamically whenever the page is loaded. Hello, visitor. The time is {{ 'now' | date: 'g' }} Steps to Add This Liquid Example in Power Pages Step 1: Open your Power Pages site using Design Studio. Step 2: Navigate to the page where you want to display the Liquid content. Step 3: Select the text component or section on the page. Step 4: Paste the Liquid expression directly into the content area. Step 5: Save the page and preview the site. When the page loads, Power Pages evaluates the Liquid expression on the server and replaces it with the current time before sending the HTML to the browser. Why This Works ...

Power Pages Liquid Overview

Power Pages Liquid Templates - Complete Guide Understand how Liquid works in Power Pages and how it helps build dynamic, Dataverse-driven portal pages and blog layouts. What is Liquid in Power Pages? Liquid is an open-source templating language built into Microsoft Power Pages. It allows developers to render dynamic content from Dataverse, control visibility, and customize portal layouts without using JavaScript. Liquid runs on the server side and outputs clean HTML, ensuring security and performance for Power Pages websites. Where Liquid is Used in Power Pages • Web Templates for reusable layouts • Page Templates to define page structure • Page content in advanced editor • Content Snippets for reusable UI blocks Core Liquid Components Liquid Objects Liquid objects expose runtime data such as cu...

Classic Workflows in Model-Driven Apps

Image
Classic Workflows in Model-Driven Apps: Complete Hands-on Guide Classic workflows are server-side automation processes in Microsoft Dataverse. They are widely used in model-driven apps for validation, automation, approvals, and record management. Classic Workflow Types and Their Usage Classic workflows in model-driven apps can be executed in different modes depending on the business requirement. Each type serves a specific purpose and choosing the correct type is critical for performance and data integrity. Workflow Type Execution Time Can Stop Save Typical Use Case Example from This Blog Background Workflow After record is saved No Automation that should not block users, such as updating fields, sending notifications, or assigning records. Set default Status to Draft when record is created. Real-Time Workflow Before record is saved ...