Javascript

Posts in this category.

Xrm.Utility.getEntityMetadata to get the localized label

May 14, 2023

I got a request to basically create PCF for Two OptionSet (boolean) with the main purpose is to keep Yes, No, and Null/Empty values. If you get the requirement, making it is not hard. But, usually in the project, we also need to support multi-languages. There's an article from...

MDA: Testing JS changes without deploying

Apr 29, 2023

Our routine as Developers, if we get a new task/bug, is "change the code", "deploy", and "validate". For the front scripting, if we don't have the tool to help us update the necessary file easily, we need to open the JS component > update > deploy and publish > then go to the...

MDA: How to invoke the formOnLoad event after saved

Apr 21, 2023

On form on load event, it is very common to set how the UI looks based on certain conditions. For instance, when the status of the entity/table is Inactive, we need to lock all the controls. So, today we will learn how to do it via JavaScript (client scripting). Without further...

Model-Driven Apps: Disable most recently used items programmatically

Mar 17, 2023

When we are talking about lookup in MDA (Model Driven Apps), sometimes we are applying some filter (either using addPreSearch or setting it manually from control properties > view) to ensure the data that the user inputted is valid: But, when we are not disabling the Most...

Model-Driven-Apps: setup deployment Angular files to Dev using spkl

Feb 5, 2023

Last week, we already learn how to build Angular WebResources to be shown in the side pane. In that blog post, I deploy all the files manually which of course took time to do. Today, we will learn how to optimize it in order to boost productivity. We will learn how to use spkl...

Model-Driven-Apps: How to use the side pane to show custom HTML

Jan 27, 2023

Today we will learn how to create a custom web resource (HTML) using Angular, and show it in the side pane using Xrm.App.sidePanes.createPane method. The end result will be like the below picture: Without further ado, let's go make the Angular apps! Angular Project Before we...

Model-Driven-Apps: Implement Editable Grid and learn how to customize it

Dec 24, 2022

Let's learn how to implement Editable Grid and apply simple customization. As the name, the Editable Grid is a grid where we can do inline editing. In this blog, I create a custom table where we will implement the below scenario: - On Qty or Unit Price changed, set Total with...

Model-Driven-Apps: Add on post-save event

Oct 15, 2022

What is the best way to add a post-save event that will always be called either success/failure? From the documentation, I see we actually can use addOnPostSave but when I try it, it didn't work as expected (later we will go through this scenario). So, as an alternative for now...

Model-Driven-Apps: How to use setIsValid method

Sep 10, 2022

When dealing with client script customization, most of the time we are dealing with data validation where the common steps are like the below snippet: var blog = blog || {}; (function() { this.formOnLoad = function(executionContext){ var formContext =...