Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 41

How to Create a collapsible Gallery control in Canvas Power App

In this blog, I am going to show how we can create a collapsing and retracting gallery control in Canvas Power app. Let’s start making this into our Canvas PowerApps Step 1: Insert a Flexible Height Gallery on the screen. For the current example, I’m using a table of User details. Items property of Gallery Step 2: Adding a ‘button’ which is stay visible all time and a ‘Container’ which will only be visible when that specific record is selected. Step 3: Adding variables to store information of selected record unique ID. OnSelect property of Button, Visible property of Container, Step 4: Modify as you like, I’ve added color indication which record is selected. That’s all, We have finally created the collapsible Gallery control in Power App. Hope this helps!!

Share Story :

How to Dynamically Filter Multi-Select Option set/Picklist in D365 CRM using JavaScript

Posted On April 27, 2022 by Sancia Dcunha Posted in Tagged in ,

In this blog, I am going to show how we can filter a field (multi-select option set) item dynamically based on another field (single-select option set) item. Let’s consider a use case, We have a field named ‘Application Area’ which is a (single-select option set) field and ‘Application Type’ which is a (multi-select option set) field. Let’s have a look at JavaScript where the magic is making this possible. Step 1: Below is the entire code of JS For Table/Entity Main Form customization, select ‘Form Properties’ to include JavaScript function as below, On Load: oApplicationAreaType.Main On Change of field ‘Application Area’: oApplicationAreaType.getDetails Note: Pass the execution context for calling the JS function. That’s all, we have created a dynamic filtering of multi-select option set using JavaScript. Hope this helps!!

Share Story :

To show validation on a field using Regex Expression

In this blog, I am going to show how we can display a validation on the field if the entered text is not in the required format Let’s consider a use case, We have a field name ‘DMV Initial License’ which is a single line of text field. When text is entered the Date format for this field should be MM/YYYY Let’s have a look at JavaScript where the magic is making this possible. Step 1: Regex Expression for Date in the required format MM/YYYY – date_regex = /^(0[1-9]|1[0-2])\/[/]?([0-9]{4})$/ Step 2: Below is the entire code of JS For Table/Entity Main Form customization, select ‘Form Properties’ to include JavaScript function as below, On Change of field ‘ DMV Initial License ’: oCustomerFormCustomization.checkDateFormat Note: Pass the execution context for calling the JS function. Hope this helps!!

Share Story :

How to throw validation notification on Fields residing in Form Header

Hi All, Have you tried setting Field level notification on the Form Header of the Record? Let’s consider an example, We have an Estimated Revenue field which should never be set a $0.00. Therefore, we must throw a notification error based on this validation. The formula for setting field level notification is generalized as follows, Now let’s see how this general formula changes based on the field’s location set on the Form. If Field is located on the Form Formula will be: If Field is located on the Form Header Formula will be: If Field is located on the Form Business Process Flow (BPF) Formula will be: Hope this helps!!

Share Story :

Use of Environment Variable inside Azure Function in C#

In this blog, we will learn how to configure and use Environment Variable in Azure Function. Concept of using Environment variable during your development which needs to deploy on multiple servers and connect to multiple systems. Whenever you use Environment variables to store the global constant or system credentials it reduces the time which was required to modify the code base for multiple deployments. Let’s get started with Creating the Azure Function and using the Environment variable. Step 1: Create an Azure Function inside the Visual Studio: I have created the HTTP Trigger Azure function inside Visual Studio and the authorization level is Anonymous Once you create an Azure Function project you will notice there are many files created with the project.  We have a “local.setting.json” file that we are going to use and it holds the environment variable while the development and testing phase of your Azure function. Step 2: Declare credentials/global variable inside “local.setting.json” Information on local.setting.json – This file represents your local application setting for your Azure Function and it stays with your local build only. While you publish your azure function to Azure Portal or commit your code to your Repo this file is never pushed to the server as they are excluded/prevent from committing or publishing. Step 3: Access variable inside the code You can access the environment variable using the Environment class(required System lib). Based on your preference you can either access Environment variable the directly inside the code or you can create a CONSTANT class as mentioned below screenshot. Here, I am passing this environment variable inside a response so that we can test it. Step 4: Testing using Postman We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/ To test the application, click on the Start button on top of the Navbar as mentioned below in the screenshot [Button will have Project Name]. It will take a few minutes to Load the Azure Emulator Following is the screen you will be able to see and copy the URL highlighted in the red below and paste that URL into Postman. Result: Now, you need to configure the Environment while deploying the Azure function on Azure Portal, and below are steps for the same: Step 1: Deploy an Azure Function on Azure Portal. You can directly create it on Portal or you can create it from Visual Studio. Here I am going to create and deploy it from Visual Studio: Right Click on the project and select Publish: Select Azure and Click on Next: Click on the + icon to create a new function, You can use the existing resource group or create a new resource group as per your preference: After deployment is completed you can see the deployed Azure function on Azure Portal: Now, if you try to use the Azure Function URL and post the request then you will notice that all the environmental credentials part is missing as we have not configured the environment variable on the Azure portal inside Azure Function App: Step 2: Configure the App Environment variable on Azure Portal for online deployment. Navigate to the Configuration section of your deployed Azure Function Add the Application setting in your Configuration and the Name should same as you have declared in your local.setting.json file. Make sure your click on Save to update the configuration on Portal. After configuration if you test your deployed Azure function using postman you will get your expected result: This is how you can configure and use the Environment variable inside your Azure Function. It will make your life easier while deploying Azure on Development, UAT, or Production Environment. You can store the Source and Destination system credentials, SQL Access credentials, or Custom Global Variable based on your business requirement of integration.

Share Story :

Create Accounting period in Business Central.

CREATION OF ACCOUNTING PERIOD. Step1. Globally search “Accounting Period” and click on the related link. Step2. To create a new accounting period, select process and then click Create year. Step3. By default, system will have a starting date as per the last created accounting period. The no. of periods is 12 by default Period length usually is 1M but can be modified to weeks or quarters. Click ok and a new accounting period is created. CLOSE ACCOUNTING PERIOD Step1. Select Process action and then click on Close Year Step2. System pops up a message stating the start and end date and once the period is closed it cannot be undone. Once you click OK, the closed and data locked column is check true. After Closing the accounting period, we need to close the Income Statement. Step1. Globally search “Close Income Statement” and select the related link Step2. The Fiscal year ending date is automatically filled by the system Step3. Select the journal template you need to post. For Journal batch, create a new batch that can be uniquely identify year end. Step4. Fill in all the necessary details. Click OK and Journal lines are created Step4. Navigate to General Journal and select the batch name Check if the balance is correct before posting.  (First preview post the entries to verify the G/L entries) Step5. Post the journal lines. After posting check the retaining earning account. Hope this helps! Thank you.

Share Story :

Here’s how to Install Power Apps for Windows (Preview) and use Model-Driven and Canvas Apps

Hi Everyone,Awaited moment is here, we finally have Power Apps designated application for Windows. Currently its in Preview so use only for testing as of now until its pushed globally. Here’s the steps to download and use Power Apps for Windows Step 1: Go to Microsoft Store and search “Power Apps” Step 2: Install the application. Step 3: In order to run this application, we need to check WebView2 Runtime version on our device. It should be version 99.0 or later. To check this, go to Settings > Apps > Apps & features. Search for WebView and verify that you have version 99.0 or later installed. For those who don’t have this, follow below steps. To install WebView2 Runtime, download the WebView2 Runtime. Download version 99.0 or later. Installing an earlier version may cause Power Apps to crash. Under Evergreen Bootstrapper, select Download. Go over the license terms and privacy statement and then select Accept and Download. When the download is complete, then run the MicroEdgeWebview2Setup.exe. Step 4: Open and sign-in with your ID Step 5: After logging in, you will find list of Model and Canvas Apps that are shared to you or you having access by security roles. The screen will show all Apps from all the environments present in you tenant. You can also see other model-driven apps if you enable Show non-production apps in settings under Model Apps. That’s all about installing Power Apps on Windows. Find the Microsoft Documentation for Installing – Microsoft Docs Find the Usage of Power Apps Windows – Microsoft Docs List of known issues – Microsoft Docs Hope this was informative and helped you.

Share Story :

Serializing and Deserializing Json objects with key value pairs in C#

Posted On March 30, 2022 by Shruti Gupta Posted in Tagged in ,

If we have a json data whose objects have one or more key value pairs also known as properties and we need to separate them into individual objects then Serializing and Deserializing method can be used in C#. Sample Json data :      {                                 “FirstName”:”Aditya”,                                 “MiddleName”:”Ashok”,                                 “LastName”:”Somwanshi”,                                 “Phone”:[“9004802526″,”34304235”],                                 “Address”:{“Primary”:”Panvel”, “Secondary”:”Cloudfronts”}                             } Desired Output: {   “FullName”: “Aditya Ashok Somwanshi”,   “Primary Phone”: “9004802526”,   “Secondary Phone”: “34304235”,   “Primary Address”: “Panvel”,   “Secondary Address”: “Cloudfronts” } First open Visual Studio and create new project in Console application template. Give your Project a name and click next, you will be directed to a new page where you can start with your code. Now we need to install some packages into our project to use it in our code. So at top in the tools section select NuGet Package Manager and in that select Manage Nuget Packages for Solution Now search for Newtonsoft.Json and install the package The purpose for installing this package is to access serialize and deserialize functions in our code. To add a class to main program you need to right click on your project and then select and choose add new item Select class and name the class and add. Now to write the code we need to use Convert JSON to C# Classes Online – Json2CSharp Toolkit for formatting the json to C# and knowing the classes to be used. using System.Collections.Generic; using Newtonsoft.Json; namespace Human {     public class Address     {         public string Primary { get; set; }         public string Secondary { get; set; }     }     public class Person     {         public string FirstName { get; set; }         public string MiddleName { get; set; }         public string LastName { get; set; }         public List<string> Phone { get; set; }         public Address Address { get; set; }     }     public class Root     {         public string FullName { get; set; }         [JsonProperty(“Primary Phone”)]         public string PrimaryPhone { get; set; }         [JsonProperty(“Secondary Phone”)]         public string SecondaryPhone { get; set; }         [JsonProperty(“Primary Address”)]         public string PrimaryAddress { get; set; }         [JsonProperty(“Secondary Address”)]         public string SecondaryAddress { get; set; }     } } Now the main program using Newtonsoft.Json; using System; namespace Human {     public class Program     {         public static void Main(string[] args)         {             string json = @”{                                 “”FirstName””:””Aditya””,                                 “”MiddleName””:””Ashok””,                                 “”LastName””:””Somwanshi””,                                 “”Phone””:[“”9004802526″”,””34304235″”],                                 “”Address””:{“”Primary””:””Panvel””, “”Secondary””:””Cloudfronts””}                             }”;//Defining Json             Person human = JsonConvert.DeserializeObject<Person>(json);//Deserializing Json             Root rt = new Root();             rt.FullName = human.FirstName + ” ” + human.MiddleName + ” ” + human.LastName;  //Concatenating Names             rt.PrimaryPhone = human.Phone[0];             rt.SecondaryPhone = human.Phone[1];             rt.PrimaryAddress = human.Address.Primary;             rt.SecondaryAddress = human.Address.Secondary;             string output = JsonConvert.SerializeObject(rt, Formatting.Indented);//Serializing Json             Console.WriteLine(output);         }     } } OUTPUT:

Share Story :

Quick Tip: Language Translation on Custom PowerApps Page in Model Driven Apps

Hi Everyone, If you are using Custom Pages in your Model Driven App and would like to have multiple languages as per User’s Personal settings? Here’s a quick helpful method for Custom Pages Step 1: Let’s start by creating a Custom Page Go to PowerApps Maker Studio, in your selected environment outside or inside a solution. Add new Custom Page Step 2: Fill your app as per requirement. I’ll just keep it basic. Note: OOTB Tables/Entities will show translated values except custom text/tooltip/custom tables, etc. Below, for my custom Title Label. I have used Language() function to detect the User’s language set in Personal Settings applied on Browser Level. Step 3: Save, Add and Publish the Page on Site Map (Edit in Preview) section. Reload your Model Driven App to see the effect User’s Language set as English User’s Language set as Spanish Select Spanish in Personal Settings That’s how simple it is to set Language in your Custom Page. Note: If you are working with Custom Entities, BPFs you need to add translation for the Language in Data verse manually. Please follow the steps mentioned in this Blog: Enable language translation on Custom solutions in Dynamics CRM. Hope this helps 🙂

Share Story :

Using Live Share in VS Code

Introduction VS Code has recently introduced a new feature using which multiple people can access the same workspace in VS Code and modify files at the same time. This is huge applications in teaching, code reviews as well as prototyping. You can edit modify separate files at the same time in the same folder. Pre-requisites VS Code References Use Microsoft Live Share to collaborate with Visual Studio Code Configuration Install the Live-Share extension in VS Code.  Click on the “Live Share” button at the bottom left.  Sign in using your Github or Microsoft Account.  You can see the session details in the “Live Share” tab along with previously connected.  Click on the “Invite Participants” to get the link what can be used to share the session.  Now, you can collaborate with different Users and modify the same or different files together.  Conclusion Thus we saw how, we can use Live Share for collaborating while developing or reviewing in VS Code. Special thanks to Vaishnavi Joshi for her help in this blog!

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange