Skip to main content

Posts

Rendering Lookup as Dropdown with Icons in Power Pages

IPower Pages offers a fantastic way to create dynamic forms, but when dealing with lookup fields, sometimes the default rendering doesn't provide the best user experience. In this blog, we will walk through how to render a lookup field as a dropdown, enhance it with custom filters, and then take it a step further by adding icons to make it more visually engaging and user-friendly. Step 1: Rendering the Lookup Field as a Dropdown For a detailed walkthrough on how to render a lookup field as a dropdown with custom filtering, be sure to check out this amazing blog: Custom Lookup Filtering on PowerApps Portal . This guide provides a step-by-step explanation of how to dynamically filter and render lookup fields as dropdowns based on specific conditions. Now that we know how to set up the basic dropdown, let's move on to how we can enhance it with icons and flags. Step 2: Customizing the Lookup Field with Filters and Icons For this example, let’s say we’re working with universities...

Display Custom Alert Messages on Power Pages Basic Forms

IIn this blog, we'll walk through how to display custom alert messages on Power Pages basic forms. This can be useful when you need to notify users about important information, form validation errors, or custom messages based on specific conditions. We'll cover the following steps: Create a Power Pages Basic Form Write the JavaScript Code for Custom Alerts Add the JavaScript to the Form Step 1: Create a Power Pages Basic Form Before adding custom alerts, ensure you have a Power Pages site with a basic form set up. Go to the Power Pages management area. Select the site where you want to add the form. Create a new basic form or edit an existing one. Step 2: Write the JavaScript Code for Custom Alerts Now, let’s write a simple JavaScript function to display a custom alert. function showCustomAlert ( message ) {     var alertBox = document . createElement ( "div" );     alertBox . innerText = message ;     alertBox . style . pos...

Trigger Power Automate Flow for Selected Records in a Single Call

In this blog, we'll walk through how to trigger a Power Automate flow on selected records using an HTTP request. We'll use a custom ribbon button placed on the main grid to send the selected records' GUIDs to Power Automate, which will then process those records. The sequence we'll follow is: Create a Power Automate Flow Write the JavaScript Script Add a Ribbon Button on the Main Grid Step 1: Create a Power Automate Flow The first step is to create a flow that will be triggered via an HTTP request. Here’s how you can set it up: Create a Flow with HTTP Request Trigger : Go to Power Automate and create a new flow. Choose the trigger When an HTTP request is received . Initialize an Array Variable : Add an action to initialize an array variable (e.g., Selected Record IDs) to store the GUIDs of the selected records. Loop Through the Array : After initializing the array, use the "Apply to each" action to loop through the array of GUIDs. Inside the loop, you can per...

Calculate Rollup Field on Delete of Related Records Using Plugins

When working with Dynamics CRM, there are instances where you may need to calculate rollup field  dynamically when a related record is deleted. This is crucial when the deletion of a child record should trigger an update on the parent record (such as recalculating a total, sum, or count). Achieving this requires leveraging Plugins in combination with Pre-Delete and Post-Delete stages. Let’s walk through the process of setting up a plugin to automatically calculate a rollup field when a related child record is deleted. Step 1: Pre-Delete and Post-Delete Execution To begin, we need to implement two Execute functions in our plugin: one for the Pre-Delete stage and one for the Post-Delete stage. Pre-Delete : In the Pre-Delete stage, we retrieve the GUID of the parent record . This is accomplished using the PreImage feature, which captures the state of the entity before the delete operation is executed. We pass this GUID to the Post-Delete stage through a shared variable, ensur...

Step-by-Step Guide: Configuring Bookable Resources in Power Pages

In this tutorial, we'll walk through the process of setting up and configuring Bookable Resources in Power Pages, enabling contacts to log in and manage their bookings. Step 1: Create a Custom Contact Lookup Field Bookable Resources can be of various types, but only contacts can log in to Power Pages. To address this, we will create a custom contact lookup field on the Bookable Resource entity. Step 2: Create a Contact Record Create Contact Record : Create a contact record that you will use to access the Portal. Set Custom Field : Assign the newly created contact record to the custom contact lookup field on the Bookable Resource entity. Step 3: Configure Table Permission for Bookable Resource Entity Set up a table permission for the Bookable Resource entity and in the Relationship field, choose the newly created contact lookup relationship. Step 4: Configure Table Permissions for Related Entities For related entities of Bookable Resources, add them as child permissions within the B...

Step-by-Step Guide: Adding a Print Button to Entity List in Power Pages

In this tutorial, we'll walk through the steps to add a custom "Print" button to an entity list page, allowing users to print the list of records or save it as a PDF. Step 1: Add an Entity List to the Page Add Entity List: First, add an Entity List to your page. Edit Code: Once the Entity List is added, click on "Edit Code." A popup will appear; select "Open in Visual Studio." Step 2: Add a Custom Button Next, we’ll add a custom button above the Entity List. Insert HTML Code: Add the following code to place a "Print" button above the Entity List: <button id="btnPrint" type="button" class="btn btn-warning" style="align-self: flex-end; margin-left: auto;">Print</button> The final code will look like this <div class="row sectionBlockLayout text-start" style="display: flex; flex-wrap: wrap; margin: 0px; min-height: auto; padding: 8px;">   <div class="containe...

How to attach Word template to Notes using Power Automate

In one of our recent projects, we had a requirement from a client to attach a Word template to a Note entity as a PDF. We accomplished this using Power Automate. Here's a step-by-step guide to help you achieve the same: Step 1: Create and Prepare the Word Template Create the Word Template: Open Microsoft Word and create a template. Instead of using XML mapping, add controls using the Developer options and properly name each control. For example, you might add controls for Name, Email, and Phone. Once you're done with the Word template, upload it on OneDrive. Step 2: Set Up the Trigger in Dynamics 365 Create an Option Set Field: In the Account entity, create an option set field with two options: Yes and No. This field will trigger the Power Automate flow when its value changes. Step 3: Configure Power Automate Populate the Word Template: Use the "Populate a Microsoft Word template" action in Power Automate. Select the Word template from OneDrive. The action will displa...