Skip to main content

Posts

Essential Dynamics 365 Plugins for Sales & Customer Service

Introduction In Dynamics 365, plugins automate business processes, enforce rules, and ensure data integrity. Whether in Sales or Customer Service , plugins help streamline workflows by executing logic at the right time in the pipeline. This post covers key plugin scenarios , detailing: ✅ Execution pipeline stage (Pre-Validation, Pre-Operation, Post-Operation) ✅ Synchronous or Asynchronous execution ✅ Pre-Image / Post-Image usage ✅ Rollback handling Rollback Handling in Plugins When Does a Plugin Rollback? A plugin automatically rolls back if: An exception is thrown in a synchronous plugin. A transaction fails in a Pre-Validation or Pre-Operation stage. How to Handle Rollbacks? Use Try-Catch Blocks : Prevent unwanted failures by catching errors and logging details. Throw an Exception When Needed : Stop invalid data changes (e.g., prevent closing an Opportunity without a Quote). Compensating Logic in Async Plugins : Since Post-Operation Async plugins do not par...
Recent posts

Powerapps: Collections in Canvas Apps | Collect, ClearCollect, Clear in Powerapps

Collections : Collections are special types of variables or data storage mechanism which can be used to manipulate the data within Power Apps.  Collections are usually a group of similar items which acts like a table of values with columns and rows.  We can create, update, delete, use it as the data source for a gallery to view the items within Power App.  Collect, Clear, and ClearCollect functions:   Collect : In Power Apps, the Collect function is used to create or update a collection in your app.  Collections are temporary data sources that allow you to store and work with data within your app.  The Collect function is versatile and can be used in various scenarios to add, modify, or remove records from a collection.  Syntax : Collect( IceCream, { Flavor: "Pistachio", Quantity: 40 }, { Flavor: "Orange", Quantity: 200 } )   Adds two records to the IceCream collection that includes a quantity of pistachio and orange ice cream.  Clear : In Po...

Understanding the Basics of Security in Dynamics 365

Security in Dynamics 365 is one of its most powerful features, enabling organizations to protect data while ensuring appropriate access for users. With a structured security model, it balances flexibility and control to meet various business requirements. In this blog, we’ll dive into the basics of Dynamics 365 security, exploring its key components and their applications. Here's how to access security:  In the latest powerapps solution interface, you can check similar security settings in Advanced settings --- Core Components of Security in Dynamics 365 1. Business Units Definition: Business Units act as logical partitions in Dynamics 365, defining the boundaries for data access. Purpose: They help segregate data for different organizational divisions (e.g., departments, regions). Hierarchy: You can set up a parent-child hierarchy to reflect organizational structures, enabling shared data access between business units. 2. Security Roles Definition: Security Roles determine what a ...

Plugins : How do you optimize your plugin for better performance?

Optimizing Performance in Dynamics 365 Plugins: Best Practices and Advanced Techniques Introduction Plugins in Dynamics 365 are a powerful way to extend the platform's functionality, but poorly designed plugins can lead to performance bottlenecks and errors. In this post, we’ll explore advanced techniques and best practices for building efficient, maintainable, and high-performance plugins in Dynamics 365. --- 1. Use Early Binding Over Late Binding Early binding improves performance by reducing runtime overhead and increasing code maintainability. Use tools like the CrmSvcUtil.exe to generate strongly-typed entity classes. Example: // Early Binding Example Contact contact = context.GetEntity<Contact>(); string firstName = contact.FirstName; // Late Binding Example Entity contact = context.GetEntity("contact"); string firstName = contact.GetAttributeValue<string>("firstname"); Early binding reduces the risk of typos and ensures compile-time validation...

JavaScript: Working with Web API Functions in Dynamics 365

Welcome to my blog! In this post, we'll explore how you can work with the Dynamics 365 Web API to interact with records and data. The Web API provides a standard, RESTful way to create, retrieve, update, and delete data within Dynamics 365. It is crucial for integrating external systems or when you're developing custom solutions. If you find this post useful, please follow and support me on LinkedIn! What is the Web API in Dynamics 365? The Web API in Dynamics 365 is a powerful, REST-based API that allows external applications or client-side code to interact with the data stored in Dynamics 365. You can use it to perform CRUD operations (Create, Retrieve, Update, and Delete), trigger business logic, and integrate third-party services. It’s designed to simplify integration and extend the capabilities of Dynamics 365. How to Work with Web API Functions in Dynamics 365 Let’s dive into some common examples of how to interact with Dynamics 365 data using Web API functions. 1. Retrie...

JavaScript: Most Commonly Used JavaScript Functions in Dynamics 365

Welcome to my blog! In this post, we will dive into some of the most commonly used JavaScript functions when developing client-side scripts for Dynamics 365. JavaScript is essential for enhancing user experience, automating processes, and interacting with form elements in Dynamics 365. Whether you're customizing forms or developing business logic, these functions will be extremely useful in your daily development. If you find this post helpful, please feel free to follow and support me on my LinkedIn profile. Let's get started! 1. formContext.getAttribute() In modern Dynamics 365, formContext is used to interact with form elements instead of Xrm.Page. To get the value of an attribute (field), we use formContext.getAttribute(). Syntax: var attributeValue = formContext.getAttribute("fieldname").getValue(); Use case: Retrieving the value of a contact's "Email" field. var email = formContext.getAttribute("emailaddress1").getValue(); 2. formContext....

Most Commonly Used Functions in C# Plugins for Dynamics 365

Welcome to my blog! In this post, we will explore some of the most commonly used functions when developing C# plugins for Dynamics 365. These functions are vital tools for interacting with data, handling errors, and customizing the behavior of your Dynamics 365 application. If you're working with plugins, these are the functions you'll most likely encounter and use. If you find this post useful, please feel free to follow and support me on my LinkedIn profile. Let’s get started! 1. IOrganizationService The IOrganizationService interface is the primary service for interacting with Dynamics 365 records. It allows you to create, retrieve, update, and delete records in the system. Most plugin operations rely on this service for performing CRUD (Create, Read, Update, Delete) actions. Commonly used methods: Create: Used to create a new record in Dynamics 365. Retrieve: Used to fetch a record from Dynamics 365 based on the entity's ID. Update: Used to update an existing record. De...