Advertisements

Archive

Author Archive

PowerApps – Create an ‘Account’ in Dynamics 365 from App using Flow

If you are new to PowerApps, please go through my previous blog

In this post, lets build an App with an Account Form and create the record in Dynamics 365.

PA_Flow_5

Prerequisite:

  • You must have a PowerApps account. Refer blog for details.
  • Create a Microsoft Flow with logic to create an Account record in Dynamics 365
  • Build an App and trigger Flow

Steps to create Flow:

  • Login to PowerApps Portal
  • Navigate to Business Logic -> Flows -> Create from blank

PA_Flow_1

  • In the new Flow screen, Choose Action, select ‘Dynamics 365’

PA_Flow_7

  • Select ‘Create a new record’ from Actions.
  • Now we need to put place holders in the fields which we pass data from PowerApp.
  • To add a place holder to ‘Account Name’ field, select the field, in ‘Dynamics content’ window, click on ‘Ask in PowerApps‘ button.
    • A new place holder will get added to ‘Account Name’ field.

PA_Flow_2

  • I repeated the above step for ‘Main Phone’ and ‘Description’ fields.

PA_Flow_3

  • Rename the Flow to CreateAccount and Save

Invoke Flow from PowerApp:

  • To know, how to create a new App and add controls to form, refer my earlier blog
  • To trigger the Flow, select the ‘Create’ button, go to ‘Action -> Flows’
  • From the ‘Data’ window, select the flow created in above section (i.e.,CreateAccount)

PA_Flow_4

  • On ‘OnSelect’ event of button, trigger the Flow ‘CreateAccount’ by calling ‘Run’ method and passing the 3 placeholder parameters.
    • CreateAccount.Run(txtName.Text,txtDesc.Text,txtMobile.Text)
  • Thats it, now its time to test the App

Test the App:

  • Press F5
  • Set the values and click ‘Create’

PA_Flow_5

  • Open the D365 App and you should see new ‘Account’ record.

PA_Flow_6

Refer my earlier article to build an App using Excel as Data Source.

🙂

Advertisements

PowerApps – Error while connecting to Excel Data Source

If you are new to PowerApps, please go through my previous blog

In my last Post building, I explained the steps to build an App using Excel file as Data Source.

While I was exploring more with that App, I encountered an error when playing with different excel files.

PA_Excel9

Reason & Fix:

  • If you have formulas defined in the Excel file, PowerApp will throw error as the PowerApps are not supporting Excel containing Formulas at this point.
  • Fix was, I had to delete Formulas and keep only data in the excel file to run the App.

🙂

Categories: PowerApps Tags: , , ,

PowerApps – Build an App using Excel data as Source

August 13, 2018 2 comments

If you are new to PowerApps, please go through my previous blog

In this post, I am going to walk you through building an App using Excel as ‘Data Source’.

I am going to build an App by

  • Prepare an Excel file with data formatted as ‘Table’
  • Place it in ‘One Drive For Business’.

Pre-requisites:

  • You must have a PowerApps account. Refer blog for details.
  • An Excel sheet with data formatted as ‘Table’.
  • ‘One Drive For Business’ account
    • This comes free with Dynamics 365 30 days trail.

Steps to configure Excel:

  • Create an Excel file with some data. I prepared ‘Customer’ records with 4 columns.
  • You should format this data as ‘Table’ as the PowerApp, only consider Tables, which you will notice in next sections.

PA_Excel1

  • Provide name to the Table; We will use this Table name in ‘Power App’. I named my table as ‘Customers‘.

PA_Excel2

  • Save the Excel

Steps to upload Excel to OneDrive:

PA_Excel3

  • Connect to ‘OneDrive’ and upload the Excel File

PA_Excel4

Steps to create App:

  • Login to PowerApps Portal
  • Create a New App with ‘OneDrive for Business’ template, as I uploaded the Excel to OneDrive.

PA_Excel5

  • Note: Its not necessary that you should pick ‘OneDrive for Business’ template, you can even create a ‘Blank app’ and create ‘OneDrive’ connection.
  • Click ‘Create’ to establish App’s connection with ‘OneDrive For Business’.

PA_Excel6

  • Choose the Excel file

PA_Excel7

  • Select the ‘Table’ and click ‘Connect’; This table ‘Customers‘ is nothing but the table name we given in ‘Excel sheet’.

PA_Excel8

  • Now you would experience the power of ‘Power Apps’ as it instantly come up with UI using the excel data. App auto create 3 screens for Browse Screen,Details Screen and Edit Screen.

PA_Excel10

  • You can reorder the columns by selecting ‘Data’ or you can change the ‘Sort Column’ if you want.
  • Finally, press F5 to run the App.

PA_Excel11.PNG

Refer my previous blog to build a simple calculator App.

🙂

 

PowerApps – Step By Step – Build a simple Calculator App

August 12, 2018 3 comments

In my previous article I detailed the steps to get started with PowerApps by signing up to the PowerApps portal.

Now, let me walk you through the steps to create and publish a simple ‘Calculator’ App.

The Calculator App will have 2 Text boxes and an ‘Operation’ dropdown. Upon clicking the ‘Calculate’ button, based on the Operation we either Sum or Subtract the values and show the result.

Calc

Pre-requisites:

  • You must have PowerApps account. Refer my previous article

Steps to build ‘Calculator’ App UI:

  • Connect to the PowerApp studio and click on ‘New App’ of Mode ‘Canvas’
  • From the ribbon, click on ‘Insert’ tab and drag & drop the controls on to the Canvas
  • For the ‘Text Input’ controls, select ‘Format’ as ‘Number’ so that it only allow digits.

Calc_1

  • Add the ‘Dropdown’ control to the Screen
  • Calc_ddl
    • To add “Sum”,”Substract” as options to the ‘Dropdown’, select ‘Items‘ property and set [“Sum”,”Substract”]
  • Add the ‘Button’ control to the screen and set the text as “Calculate”
  • Add 3 labels
    • Label ‘A’, Label ‘B’ and Label ‘Result’

Steps to add the business logic:

  • On buttons ‘OnSelect’ event,
  • Calc_resultbutton
    • Declare a variable “varResult”
    • Read the selected operation (i.e., Sum/Subtract) from the Dropdown
    • Write an If/Else statement
      • Add TextA, TextB; if the dropdown values is ‘Sum’ If(ddlOperation.Selected.Value=”Sum”,txtA.Text+txtB.Text))
      • Subtract TextA, TextB; if the dropdown values is ‘Substract’ If(ddlOperation.Selected.Value=”Substract”,txtA.TexttxtB.Text))
      • Set the Sum/Subtract value to the “varResult” variable using ‘Set‘ method
    • Finally, we should display the result by setting it to ‘Result’ label. So, set ‘Text’ as ‘varResult’

Calc_resultlabel

Time to Test the App:

  • Press F5 to test the App

PAPP_5

Save and Publish the App:

Once you done with testing, its time to Save and Publish the App.

  • To save the App, either press (Ctrl+S) or go to File -> Save

Calc_Save

  • Choose either ‘The Cloud’ option or ‘This computer’
    • ‘Cloud’ option would save the App in your ‘PowerApps’ account
    • ‘Computer’ option would provide the App in .zip folder to save locally.
  • Post save, to make the App available to Users, click on ‘Publish’

Calc_Publish

Notes:

  • PowerApps provides excel like formulas to apply business rules. Refer this blog to get exhaustive list of formulas.

🙂

 

Categories: CRM, PowerApps Tags: , ,

PowerApps – Getting started

August 12, 2018 4 comments

PowerApp is a service from Microsoft Business Application Platform (BAP) for creating business applications that can run in a browser or on a phone or tablet, and no coding experience is required.

Its a 3 step approach to create an App

  • Connect to a Data Source; It can be your Dynamics 365, Azure SQL/SQL On premise, API, etc…
  • Build the UI forms and add business logic using Workflows (i.e., Microsoft Flow, Azure Functions etc..)
  • Publish the App

PAPP_Intro

In this article, I am going to walk you through the steps to subscribe to Microsoft PowerApps and getting started with your first App.

Steps to connect to PowerApp Studio:

PAPP_SignIn

  • Click ‘Sign up free’ if you don’t have account already
    • Note: You can sign in with your 30 days trail account, if you already have one.
  • Click ‘Sign In’ if you have an account
  • Once you login to the Portal
  • PAPP_1
    • Select ‘Apps’ from the Menu
    • Choose ‘Design Mode’
      • Canvas : This mode allows to create the app by dragging and dropping elements onto a canvas, just as you would design a slide in PowerPoint. This mode is apt if your requirement is to build a custom forms with rich UI.
      • Model-drivenModel-driven app design is a component-focused approach to app development. Example of this mode is creating ‘Apps’ in D365.
  • Click on ‘Create an App’ button

PAPP_1

  • Pick your App style
    • If you are beginner, go with Canvas ‘Tablet Layout’

PAPP_2

PowerApp IDE’s:

There are 2 ways to build the Apps

  • PowerApp Studio – Web : In this option, you can build and Publish the App from the browser.
  • PowerApp Studio – Desktop App: You can also download the PowerApp desktop application from Here

In the next article, lets see how to create a simple Calculator App.

🙂

 

Categories: PowerApps Tags: , ,

CRM 2011 (on-premise) – Querying Filtered views from CRM DB

We recently working on Data migration from CRM 2011 on-premise to Dynamics 365.

We got the CRM 2011 SQL DB back up, which we restored in our SQL server. But when we run query on ‘Filtered’ views we were getting 0 results.

FilteredView_1

Reason:

  • FilteredViews always run on CRM User context
  • The account I logged in to SQL server is not a CRM User/Service Account and hence Filteredview returning 0 results

Fix:

  • Before you querying ‘Filtered’ view, set the Context to CRM User using GUID
  • Below is the syntax:

— Set the Context

DECLARE @userid uniqueidentifier;
SET @userid = convert(uniqueidentifier, ‘123A81A3-89C3-E411-B6EF-441EA155CAB5’);
SET CONTEXT_INFO @userid;

–Execute the query
Select top 10 name,statecode,statecodename from FilteredAccount (nolock)

  • GUID used in above query is the valid CRM user’s GUID.
  • Now we should get the Accounts based on the Privilege and Access level of the User GUID we set the context with.

FilteredView_2

Dynamics 365 – Different types of User Accounts and License consumption

Other day I was asked a question “What are the options to create/migrate users in Dynamics 365 application with no license consumption”

The options are

  • Create a User of type ‘Stub User’ which does not consume license
  • Sync a User from O365 to Dynamics 365 and remove the license later. This approach deactivates the User in D365 and free up the license.
  • Create an Application User
  • Create an Administrative User account
  • Create a Non-Interactive User account

To know different options is crucial, especially, when you are migrating the Users from legacy systems and the Users are not expected to access the D365 application which should not cost any licenses.

In this article, I am going explain the different type of Users and how they consume the licenses.

Administrative User Account:

  • An Administrative user is a user, who has access to the Settings and Administration features but has no access to any of the customer engagement functionality.
  • Since the administrative user does not have access to customer data and any of the customer engagement functionalities, it does not require a Dynamics 365 (online) license.
  • To create an ‘Administrative User’
    • Create a User in Office 365; (Admin Center -> Users -> Active users -> Add a user)
  • User2
    • Assign a Dynamics 365 license under ‘Product licenses’ tab.
  • User3
    • Go to D365 application and open the User record
    • On the User form, under ‘Administration’ tab, ‘Client Access License (CAL) Information’ section and select “Administrative” for Access Mode.
  • User1
    • Final step is, remove the Dynamics 365 license of the User from Office 365, so that you can free the license and still the User can login to the application as ‘Administrative’

Non-interactive User Account:

  • Non-interactive user is not a physical User and It is used for programmatic access to and from Dynamics 365 between applications.
  • Non-interactive user let applications (i.e., Consoles, SSIS packages or ERP connector etc.) authenticate and access Dynamics 365 (online), without requiring a Dynamics 365 (online) license.
  • Creation of Non-interactive user account is same as Administrative User Account, except setting the Access Mode to ‘Non-interactive’
  • There is a limit of five non-interactive user accounts

Application User Account:

  • ‘Application User’ is used while establishing server-to-server (S2S) authentication
  • ‘Application User’ with conjunction of Azure Active Directory (Azure AD) will establish S2S authentication.
  • ‘Application User’ does not consume license.
  • Application users are created with a non-interactive user account, however they are not counted towards the 5 non-interactive user accounts limit.

Stub User:

  • Stub user cannot log in, cannot be enabled, and cannot be synchronized to Office 365 and will not consume license.
  • Stub Users are designed for records that have been imported that refer to this user but the user does not exist in Dynamics 365 (online).
  • Stub users are user records that are created in Dynamics 365 using Data Import or using the Create or Create Requests methods of the SDK.

Licensed User:

  • Licensed user is an User whom gets created in O365 with license and synced to D365.
  • Licensed users must be assigned at least one Dynamics 365 security role to access Dynamics 365 (online).
  • The service does not allow access to users who do not have at least one security role.
  • Removing all security roles from the user prevents the user from signing into and accessing Dynamics 365 (online). However, it doesn’t remove the license from the user.

Refer article for more details.

🙂