Power FX Cheat Sheet for Commands in Model-Driven Apps

Fredrik Engseth
6 min readNov 5, 2022

Introduction

This post covers different Power FX snippets for customizing Commands in Model-Driven Apps. Power FX is the new approach for creating logic and visibility rules on Commands in Model-Driven Apps instead of using JavaScript and RibbonWorkbench.

The examples are meant to be a look-up guide or a cheat sheet to have a place with frequently used snippets. This is no complete cheat sheet list, but some snippets that came to mind at the time of writing and with the experience I got with PowerFX so far. Hope you find it useful.

Table of Content

  • Prerequisite
  • Setting up a Trial Environment
  • Notifications in a Model-Driven App
  • Create a Success Dialog and Notification Message
  • Create an Abort Dialog and Notification Message
  • Notification Banners
  • Visibility Formulas in Model-Driven App
  • Show or Hide Commands in a List View
  • Hide a Command Commands During Record Creation
  • Show Commands Based on Record Data
  • Patch Function (Update And Create)
  • Create a Related Record on the Current Record
  • Update Current Record
  • Update Multiple Selected Records in a Grid
  • Update Multiple Selected Records with Dialog and With Certain Criteria
  • Navigation
  • Navigate to the Default View of the Table
  • Navigate to Specific System View of the Table
  • Open Multiple Records in a New Tab
  • Conclusion
  • Resource Links

Prerequisites

  • A trial or environment for customizing apps
  • Familiar with Model-Driven Apps
  • Familiar with Ribbon Customization in Model-Driven Apps
  • Familiar with Power FX

Setting up a Trial Environment

--

--

Fredrik Engseth

Developer | Dynamics 365 | Power Platform | Azure | Personal development | Investments