Posts

Showing posts with the label Dataverse

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...

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...

Business Rules (Model-Driven Apps & Dataverse)

Image
Business Rules in Microsoft Dataverse Business Rules allow you to define logic, validations, and UI behavior on Dataverse table forms without writing code. They work mainly inside model-driven app forms and partially in server-side operations depending on the scope. 1. Scope of Business Rules Entity – Applies to all forms of the table and also runs server-side when the record is created or updated by API/flows. All Forms – Applies to every model-driven form associated with the table. Specific Form – Applies only to the selected form. Note: Canvas apps require the rule to be set at table (Entity) scope, but Canvas apps support only limited actions. 2. Components of a Business Rule Condition – Evaluates field values or expressions. Set Field Value – Automatically fills or changes a field value. Clear Field Value – Removes existing values. Set Business Required – Makes a field Required, Optional, or Recommended. Set Visibility – Shows or...

Dataverse: Alternate Keys, Change Tracking, and Auditing

Image
Dataverse: Alternate Keys, Change Tracking, and Auditing 1. Alternate Keys What are Alternate Keys? Every Dataverse row has a system-generated primary key ( GUID ). An alternate key is a user-defined unique identifier built from one or more columns (for example, Account Number or Account Code + Region ). It lets Dataverse uniquely identify records using business-friendly values instead of GUIDs. When should you use Alternate Keys? Data integration – External systems don’t store Dataverse GUIDs but have their own IDs. Upsert operations – To update-or-insert (UPSERT) records using a natural key like AccountNumber . Uniqueness enforcement – Prevent duplicates at database level. Lookups without GUID – Power Automate / API can reference records by alternate key instead of GUID. How to create an Alternate Key (Maker Portal) Open make.powerapps.com and...

Access Team via Subgrid vs Manual Access Team in Dataverse

Access Team via Subgrid vs Manual Access Team in Dataverse In Dataverse, the term Access Team is used in two different ways, which often confuses makers: Access Team (Template + Subgrid)  - system-generated team created per record. Access Team (Team Type = Access)  - manual team created from Teams and used with the Share button. 1️⃣ Access Team via Subgrid + Template (System-Generated) This type of Access Team is created when you configure an Access Team Template and add a User subgrid on the form. How it works: You create an Access Team Template for a table (for example: UserOwned ). You add a subgrid to the main form and set: Table = Users (systemuser) View = Associated Member View Team Template = Your Access Team Template On each record, you add users to this subgrid. Dataverse automatically creates a hidden access team for that record and shares the r...

Understanding and Configuring Access Teams(Template) in Dataverse

Image
Understanding and Configuring Access Teams(Template) in Dataverse Access Teams in Dataverse allow you to share a specific record with selected users without giving them full table access. This is useful for applying record-level security .   1. Enable Access Teams for the Table First, open your table and turn on the Access Teams setting. This allows the table to use record-level sharing through Access Team Templates. 2.   Enable Access Teams in the Environment Go to Power Platform Admin Center Select your environment Navigate to Settings Open Templates Select Access Team Templates 3. Create an Access Team Template In the Access Team Template form: Enter a Name Select the Table Name (Example: UserOwned ) Save and close 4. Add the Team Template to Your Solution (Important) This is required to use the template inside the form designer. Open your Solution Click Add Existing Click More Select Team Template Choose the ...

Dataverse - Formula Type Column

Image
📌 Dataverse - Formula Type Column A Formula Type Column in Dataverse allows makers to write Power Fx formulas to compute values automatically. Once saved, Dataverse recalculates the result whenever referenced fields change. ✔️ Supported Power Fx Functions (from official docs) Formula columns support a subset of Power Fx functions: Math Operators: +, -, *, /, %, ^ Logical Operators: And(), Or(), Not(), !, =, >, <, >=, <= String Operators: & (concatenate), in, exactin Text Functions: Upper(), Lower(), Trim(), Left(), Right(), Mid(), Concatenate() Date & Time: Today(), Now(), Year(), Month(), Day(), Hour(), Minute() Logic & Conditions: If(), Switch(), Coalesce(), IsBlank() Conversion: Value(), Text() (with limitations) Record references: LookupColumn.Field (simple parent lookups only) ❗ Not Supported: Fi...

Rollup Column in Dataverse

Image
📘 What is a Rollup Column in Dataverse? A Rollup Column in Dataverse is a special type of column that automatically calculates aggregated values from related child records or from a hierarchical relationship within the same table. It uses background system jobs to compute values and does not update immediately on the form. 🟢 What Rollup Columns Can Calculate SUM  - Total of related values COUNT  - Number of related records MIN / MAX  - Lowest or highest value AVG  - Average of related records Latest Date  - Most recent related activity 🟡 Important Characteristics Calculates using asynchronous jobs (not real-time) Refreshes every 1 hour or when manually recalculated Supports only numeric & date data types Requires a related child table or self-hierarchy lookup 🛠️ How to Create a ...

Column Security and Masking rules in Dataverse

Image
Column Security in Dataverse Column Security in Dataverse allows administrators to control who can view, update, or create data at a column level . It is useful when you want to protect sensitive information such as salary, email, bank details, and personal ID fields. 🔍 Why Use Column Security? Protects sensitive data from unauthorized users. Gives granular control - separate read, update, and create permissions. Works with all security roles, teams, and business units. Ensures compliance by restricting visibility to authorized users only. ⚙️ How It Works You enable security on a specific column inside a table. Then create a Column Security Profile . Add users or teams to the profile. Grant permissions like Read, Update, Create. ⚠️ Limitations of Column Security Must be enabled per-column manually (not global). Increases ad...