cancel
Showing results for 
Search instead for 
Did you mean: 

Join the discussion

Most Recent
sandeepstw
Super User
Super User

AI was available even before 30 November 2022, but everything changed after this date. Do you want to know why? Well, the day ChatGPT launched, and it added so much value in our work and personal life, so we are not even able to think about a day without AIBut what makes ChatGPT or other AI models so special now as I told AI was even available before 30 November 2022 that LLM.  

Read more...

maqsoftware
Regular Visitor

In this blog post, learn how to enable offline capabilities in PowerApps to ensure continuous productivity and data integrity for mobile and field workers. We'll explore how to store data locally, detect network changes, and synchronize data seamlessly once connectivity is restored. Follow our steps to make your Power App efficient both online and offline.

Read more...

Rahman1005
Advocate III
Advocate III

In this blog, we'll connect to Dataverse using an Azure function that utilizes the .Net core 6.2 framework.

The prerequisites are listed below.

  • Create a new Dynamics 365 application in Azure.
  • Make that the newly created Azure Function builds appropriately.
  • To establish a connection with the Dataverse, use this sample of code.

Create a new Dynamics 365 application in Azure:

 

We need to register the Dynamics 365 Web API on Azure and use it with an application user. This is particularly useful for those working with custom APIs in CRM.

 

To achieve this, you will need the following components.

  • Azure portal access
  • Application user
  • CRM Admin user

Log in to the Azure portal, search for " Microsoft Entra ID," and click on it.

Rahman1005_0-1719815961428.png

 

We need to select App registration.

Rahman1005_1-1719815961431.png

 

 

Fill in the required details and shown below the preferred options. I selected the first option, which is for single-tenant users only. Once completed, click on "Register." An application (Dynamics 365) will be registered, and its details will be available in the Overview tab.

Rahman1005_2-1719815961435.png

 

Application ID – The Application ID is a unique, unchangeable identifier for this application. Directory (Tenant) ID – The Tenant ID is the identifier of the AAD directory where the application was created. Next, you need to grant permissions to the API. Refer to the screenshot below.

Rahman1005_3-1719815961439.png

 

 

Rahman1005_4-1719815961444.png

 

 

Navigate to API permissions, click on "Add a permission," and select "Dynamics CRM." Choose delegated permissions and check the "user impersonation" option. Finally, click on "Add permissions.

Rahman1005_5-1719815961451.png

 

 

Here are the reasons for enabling user impersonation in the application:

  • The user calls the API with another AAD ID in the header.
  • The user is authenticated as a valid AAD user.
  • Permissions are checked to determine if the user can impersonate.
  • The AAD ID is read from the header.
  • Every call is now made as if it is by the user specified in the AAD ID header (including calls to Graph API, Dynamics CRM, etc.)

After granting permissions, the next step is to create a client secret ID.

Rahman1005_6-1719815961453.png

 

 

Add a new client secret and select its expiration date.

Rahman1005_7-1719815961454.png

 

Click on "Add" to generate a client secret. Please save the client secret in a notepad file. Refer to the screenshot below for guidance.

Rahman1005_8-1719815961456.png

 

We have successfully deployed the Dynamics online Web API. Now, let's proceed to create an application user in CRM.

Navigate to https://admin.powerplatform.microsoft.com/ and select your environment and click on setting as shown in below screen short.

 

Rahman1005_9-1719815961459.png

 

 

Next under Users and permissions click on application users.

Rahman1005_10-1719815961461.png

 

Click on New app user.

Rahman1005_11-1719815961462.png

 

Choose the app registered in Azure, then assign it to the appropriate business unit and add the desired security roles. In my case, I added the admin role to my app.

Rahman1005_12-1719815961463.png

 

Let's test the API on Postman.

To consume the Web API, first, we need to generate an authorization token. This can be done by making a GET API call to the following endpoint:

URL:https://login.microsoftonline.com/<TENANT ID>/oauth2/token

 

Rahman1005_13-1719815961468.png

 

Please include the following parameters in the API body:

  • client_id: This should be the client ID of the registered Azure application.
  • client_secret: This will be the value of the client secret generated in certificate and secrets.
  • resource: The value of this parameter will contain the URL of the CRM instance.
  • grant_type: This parameter will have a value of client_credentials.

The Client Credentials grant type is utilized by clients to obtain an access token outside of the context of a user. Upon making the request above, we will receive an access_token in return with a status code of 200.

I am obtaining CRM contacts by using an odata query in the request provided above. The details of the request are given below. The method used is Get. The URL is

https://org18828102.crm5.dynamics.com/api/data/v9.2/contacts

The above URL can be accessed by navigating to SettingsàCustomization à Developer resources, and finally to Service root URL.

Rahman1005_14-1719815961471.png

 

 

This token is intended for performing CRUD operations via WEBAPI. I will provide an example of a GET request used to retrieve data from CRM.

 

Rahman1005_15-1719815961475.png

 

Create Azure Function builds appropriately:

I am writing below Azure function to create a contact record through the Service client.

The subsequent action involves deploying the Azure function and then conducting a test using Postman or a web browser.

Conducting a test of the Azure function using Postman.

using System;

using System.IO;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;

using Microsoft.Azure.WebJobs;

using Microsoft.Azure.WebJobs.Extensions.Http;

using Microsoft.AspNetCore.Http;

using Microsoft.Extensions.Logging;

using Newtonsoft.Json;

using Microsoft.PowerPlatform.Dataverse.Client;

using Microsoft.Xrm.Sdk;

using System.Collections.Generic;

 

namespace CreateContactfromAzurefunction

{

    public static class Function1

    {

        [FunctionName("Createcontactrecord")]

        public static async Task<IActionResult> Run(

    [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,

    ILogger log)

        {

            log.LogInformation("C# HTTP trigger function processed a request.");

            var _contactid = new Guid();

            try

            {

                string _clientId = "e69c80b6-615d-4c4f-97c5-88c9306e1aae";

                string _clientSecret = "sPZ8Q~152D_aVvp4TO_Fxem7iTLSP0B4Ab1OOaqI";

                string _environment = "org18828102.crm5";

                var _connectionString = @$"Url=https://{_environment}.dynamics.com;AuthType=ClientSecret;ClientId={_clientId}

                ;ClientSecret={_clientSecret};RequireNewInstance=true";

 

 

                var service = new ServiceClient(_connectionString);

                if (service.IsReady)

                {

                    _contactid = await GetContacts(service);

                }

 

 

            }

            catch (Exception ex)

            {

              return  new  OkObjectResult(ex.Message);

                throw new(ex.Message);

 

            }

            OkObjectResult testrecord = new OkObjectResult("Contact Record created with ID " + Convert.ToString(_contactid));

            return testrecord;

        }

 

        private static async Task<Guid> GetContacts(ServiceClient service)

        {

            Guid _contactid;

            // Create a contact

           

            Entity contact = new Entity("contact")

            {

                ["firstname"] = "Rahman",

                ["lastname"] = "Dynamics CRM"

            };

            _contactid = service.Create(contact);

            return  _contactid;

        }

 

       

    }

}

Copy the local host URl and send post request from postman as shown in below screen.

Rahman1005_16-1719815961477.png

 

Rahman1005_17-1719815961480.png

 

 

Rahman1005_18-1719815961482.png

 

 

Below records is created in dynamic in contact entity.

Rahman1005_19-1719815961484.png

 

 

Thank you...!

Amik
Super User
Super User

Scenario

 

We want to copy a record and display the attributes of that copied record on an EditForm. We then want to have the option to save the copied record as a new record in our data source.

Read more...

carsten_dick
Regular Visitor

In this blog, you'll learn how to get started with Power Platform and Azure DevOps to

  • shape the collaboration in development teams and
  • buildup ALM for your organization.

When we deal with Microsoft Power Platform and the development of apps and process automation, we quickly come across the topics of "distribution of solutions in the company" and "development of solutions in development teams". These are the topics that DevOps and Application Lifecycle Management, or ALM for short, deal with.

Read more...

maqsoftware
Regular Visitor

In this blog post, we will walk through the steps to create a Power App that converts Word, Power Point, or Excel documents to PDF format.

Read more...

maqsoftware
Regular Visitor

In this blog post, we will walk through the steps to create a Power App that displays Word, Power Point, or Excel documents stored in a SharePoint Online (SPO) document library, converted on the fly into PDF format and viewed using the PDF viewer control in Power Apps. This solution is especially useful for scenarios where there are few document creators but many document consumers, accessing a variety of document types.

Read more...

maqsoftware
Regular Visitor

In this blog post, we will talk about how organizations can make the most of pipelines. Pipelines help teams adopt automated ALM practices more easily, cutting down on the effort and expertise needed to see results.

Read more...

SebS
Super User
Super User

🚀 Revolutionize Your Invoice Management Workflow! 📧💼

Discover how to seamlessly send emails with PDF attachments using Office365 Outlook while simultaneously updating attachments in SharePoint Lists. Our step-by-step guide, coupled with visual references, ensures efficiency and accuracy in your invoicing process. Say goodbye to manual tasks and hello to a streamlined workflow! Stay tuned for the ultimate integration journey. Coming soon! 🎉 #InvoiceManagement #Office365 #PowerApps #SharePoint

Read more...

c_stringham_
Helper I
Helper I

Are you an MSP looking to revolutionize the way you communicate with your clients? Discover how to leverage the Microsoft Power Platform and SendGrid to create a dynamic, cost-effective notification system that’s easy to use and maintain. Say goodbye to additional contact lists and hello to customizable, streamlined messaging. Don’t miss out on this game-changing approach—read on to transform your MSP communications now! 

Read more...

wyattdave
Responsive Resident
Responsive Resident

This series is all about creating components from other components. PCF maybe the best choice but it isn't always enabled and requires a different skillset.

This blog is all about making a multi list sorter (mainly designed for mobile devices)

Read more...

LaurensM
Super User
Super User

Ah, the good old If & Switch conditional statements! One of the first Power Fx functions you’ll familiarize yourself with when working with Canvas Apps.

 

In this blog post we’ll shortly familiarize ourselves with the Power Fx If and Switch functions. More importantly, we’ll look at some tips & tricks to easily improve code readability and scalability.

Read more...

SebS
Super User
Super User

Creating dynamic content in Power Apps can significantly enhance user experience, especially when generating documents like invoices. In this guide, we will walk through the steps to create a dynamic invoice using string interpolation and mimic CSS styles using variables.

Read more...

rampprakash
Super User
Super User

This blog post will guide you through the process of running asynchronous plugins or workflows in your Dataverse environment.

Read more...

Rahman1005
Advocate III
Advocate III

In this article I will show you how to make a tabbed form. We will create form tabs we place a tab list control above a form and show/hide its input fields based upon the current selection.

We need to enable modern controls in your app. Click on Settings > General and search for "modern". Enable the Modern controls and themes feature.

Please fellow below screen shots.

Rahman1005_0-1715861140400.png

 

 

Rahman1005_1-1715861140403.png

 

 

Setup The SharePoint List:

Create a new SharePoint list called Employee information with the following columns:

Employee Name (single-line text)

Employee Id (single-line text)

Department (single-line text)

Mobile Phone (single-line text)

Email Address (single-line text)

Address (single-line text)

Additional Information (multiple-line text)

 

Rahman1005_2-1715861140405.png

 

 

Navigate to https://make.powerapps.com/ and Open Power Apps Studio and create a new app from blank. Add a text control onto the screen to show the title “Contacts.” Then insert a tab list control.

 

Rahman1005_3-1715861140408.png

 

 

On item property of the tab list control write below code.

["General", "Contact Info", "Location", "Additional Information"]

 

 

Rahman1005_4-1715861140409.png

 

 

Add An Edit Form Control:

 

Add new form control directly below the tab list to display the Employee data.

 

Rahman1005_5-1715861140412.png

 

 

 

 

Add the employee information data source to the app then use this code in the Items property of the form.

Rahman1005_6-1715861140415.png

 

We need to write logic on fields to Show/Hide Fields on the Form.

 

On select of "General" tab we want to show the following cards and hide the rest, select the cards and write code on visible property, prefer below screen short.

 

TabList1.Selected.Value="General"

 

  • Employee Name
  • Employee Id
  • Department

 

Rahman1005_7-1715861140419.png

 

 

 

On select of "Contact Info" tab we want to show the following cards and hide the rest, select the cards and write code on visible property, prefer below screen short.

  • Mobile Phone
  • Email Address

Rahman1005_8-1715861140421.png

 

 

On select of "Location" tab we want to show the following cards and hide the rest, select the cards and write code on visible property, prefer below screen short.

  • Address

Rahman1005_9-1715861140424.png

 

 

Save the canvas app and publish the apps.

Final screens.

Rahman1005_10-1715861140425.png

 

 

Rahman1005_11-1715861140426.png

 

 

Rahman1005_12-1715861140427.png

 

 

Rahman1005_13-1715861140428.png

 

 

Thank you..!

markinwaukesha
Advocate I
Advocate I

There are many advantages to utilizing stored procedures such as: reducing application complexity, improving speed by executing at the database level rather than on the client side, eliminating the record limit and using design patterns to improve the overall architecture. 

I'll share my journey into using Stored Procedures and I hope it will help either excite you into trying them or assist you with any blockers you may have with using them.  

Read more...

wyattdave
Responsive Resident
Responsive Resident

This series is all about creating components from other components. PCF maybe the best choice but it isn't always enabled and requires a different skillset.

The first in the series is all about creating a stack of notifications (very much like how this community site shows notifications).

Read more...

happyume
Multi Super User
Multi Super User

In this article, we will learn how to get the first and last date of a month for a user selected date in the DatePicker control. There can be many use cases for such utility which provides first date and last date of the month corresponding to a user provided date. Example of such use cases can be Billing and Invoicing Systems, Event Scheduling, Report Generation, Due Dates and Deadlines for task or project management applications, Interest Calculation, Subscription Renewals.

Read more...

happyume
Multi Super User
Multi Super User

This article shows how to obtain the number of records in a gallery (or a datasource) without asking user to scroll all the way to the bottom. It overcomes the limitation of 100 records count.

Read more...

TuongDoan
Responsive Resident
Responsive Resident

One challenge when creating a modern-looking canvas app is that we have a mixed usage of classic and modern controls, and you may notice that the text in modern controls appears smaller than in classic controls. To maintain visual consistency, we need to keep the font size consistent across all the app's controls

cover_fontsize1.png

Read more...

Rahman1005
Advocate III
Advocate III

Introduction

One of the most common requirements while pushing the record in Dynamics 365 is to check whether a record is already present or not. If not, then create a new record else Update the existing record with updated information.

This requirement can easily be achieved through Power Automate as well, however today we shall learn how this can be achieved through PowerApps itself using Patch Function.

Basically, Patch Function is useful to perform following operations in any data source:

  • Create (single or multiple) records
  • Update (single or multiple) records
  • Merge records

Now, I will use following two Patch function and Let's see what result I get:

Below syntax use to Create a record in Database Table:

Patch(Customers, Defaults(Customers), {ID: "3"}, {First Name: "firstnametext"}, {Job Title: "jobtitle_text"})

Below syntax use to Update the record in Customer Table where ID = 2:

Patch(Customers,First(Filter(Customers, ID = "2" ) ), { Job Title: "jobtitle" } )

Now, Let's understand this, by taking a very simple example from Dynamics 365 perceptive.


Scenario: I want to create a contact in Dynamics 365, If contact with same emailaddress is already present in Dynamics then only Update its details else Create a new contact record.

Step 1: Create a new Canvas App (ignore if you already have) > Connect to Dynamics 365 Data Source.> Connect to contact Entity.

Rahman1005_12-1714372904603.png

 

Step 2: Insert a Blank Screen in order to add few Text Input and Button Controls or you can design the app as per your requirement.

Rahman1005_13-1714372904606.png

 

Step 3: Insert a Success Screen to show Success Message, once the record gets Created/Updated in Dynamics 365

Rahman1005_14-1714372904608.png

 

Step 4: Write following formula on Button Control (onSelect property)

If(IsBlank(

LookUp(Contacts,emailaddress1 =Emailaddress_Text.Text)),

Patch(Contacts,Defaults(Contacts),{'First Name':firstname_text.Text},{'Last Name':lastname_text.Text},{emailaddress1:Emailaddress_Text.Text},{'Home Phone':phone_text.Text}),

Patch(Contacts,First(Filter(Contacts,emailaddress1 =Emailaddress_Text.Text)),{'First Name':firstname_text.Text},{'Last Name':lastname_text.Text},{emailaddress1:Emailaddress_Text.Text},{'Home Phone':phone_text.Text})

);

Navigate(SuccessScreen,ScreenTransition.Fade);

 

Rahman1005_15-1714372904613.png

 

Step 4: Run the App

No Contact records present in dynamic 365

Rahman1005_16-1714372904615.png

 

Run canvas app in order to create contact record in dynamic 365.

Rahman1005_17-1714372904616.png

 

Fill the details and click on Submit.

Rahman1005_18-1714372904617.png

 

Record will get created in Dynamics 365 and Navigate to Success Screen.

Rahman1005_19-1714372904618.png

 

A new contact has been created in Dynamics 365.

Rahman1005_20-1714372904620.png

 

Now I am updating Last Name and mobile phone and Click on submit.

Rahman1005_21-1714372904621.png

 

Submitted information in Dynamics 365 and Navigate to Success Screen.

Rahman1005_22-1714372904622.png

 

Existing contact Record has been updated with updated Last Name and mobile phone.

Rahman1005_23-1714372904624.png

 

Thank you..!

happyume
Multi Super User
Multi Super User

This article shows how to get Dataverse record for current logged in user from the systemuser table.

Read more...

maqsoftware
Regular Visitor

In this blog post, we'll delve into how organizations can harness the power of the Microsoft Translator Connector within PowerApps to seamlessly integrate multilingual capabilities, ensuring a smoother user experience across linguistic boundaries. 

Read more...

Amik
Super User
Super User

Scenario

 

I recently came across the following scenario posted on the forums and I moved my response to this blog.

Read more...

JR-BejeweledOne
Super User
Super User

Do you need a simple way to create a custom ID that auto-increments and even resets at the beginning of the year?

Read more...

SpongYe
Super User
Super User

Named Formulas allow you to create your own reusable properties within your app. Imagine defining custom calculations like a pro mathematician, but without the headache.  These formulas streamline initialization and enhance app performance. 

Read more...

sandeepstw
Super User
Super User

In today’s competitive job market, organizations receive numerous resumes daily. Manually reviewing each one can be time-consuming and prone to errors. In this blog, we’ll explore how to automate the resume screening process using Microsoft Power Automate. By leveraging its advanced capabilities, we can streamline the hiring process and identify the most promising candidates efficiently.

Read more...

EricRegnier
Most Valuable Professional
Most Valuable Professional

Ever wondered if you had the latest and greatest version of the Plugin Registration Tool (PRT) or Configuration Migration Tool (CMT)? And always had to Google Bing Copilot it to find and download the tool? You can now just pac it!

Read more...