Getting entity record counts

RetrieveTotalRecordCountRequest to get the total record counts instead of navigating through pages 🙂

Dreaming in CRM, PowerApps & Flow

There are couple of ways to gets entity record counts: you could use XrmToolBox’s Record Counter Tool, or write the FetchXml to count the records as you navigate from one page to the next. But, if you just want to use the SDK here is a simple method: a new message called RetrieveTotalRecordCountRequest. Here is how to use it in C#:

Retrieve Record Count

Here is the same call in JavaScript:

Retrieve Record Count JS

Hope this is useful.

Reference:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.crm.sdk.messages.retrievetotalrecordcountrequest?view=dynamics-general-ce-9

View original post

Advertisements

SSRS and Power BI comparison for Dynamics 365 CE Reporting

Hi,

Was recently working on a comparison between using SSRS and/or Power BI for reporting for Microsoft Dynamics CRM, below are some of the points we came up

SSRS has always been Reporting Tool of choice for Microsoft Dynamics CRM and has been natively integrated with the application.

  • Microsoft Dynamics CRM offers Report Parameters for SSRS that are specific to CRM and can be used while writing custom reports using SSRS.
  • Microsoft Dynamics CRM provides CRM
    Pre-filtering feature using which user can use to create a context-sensitive report. Pre-filtering basically passes the specific record (or selected records) information on which report is to be run and renders the result after pulling the information from those record(s). These reports can be uploaded and run from inside the form or grid (list of records) or from the Reports Area within CRM.
  • Microsoft Dynamics CRM provides Filtered Views against which SSRS Report are written.  Filtered views conform to the Microsoft Dynamics CRM security model so the data shown in an SSRS report using a filtered view would only contain the data the users can view and has access in CRM
  • SSRS Reports adheres to Security Model of Dynamics CRM. They can viewable by the Organization or Individual. Individual reports can be shared with other users within the system through the Sharing feature.
  • SSRS is an ideal solution for something to be printed, for e.g. operation documents like invoices, work order, etc. as it gives fine-grained control over location as well as formatting of each of the report components/controls.
  • SSRS has support for more advanced printing features such as footers, headers, watermarks, and page numbers. We can easily configure the margins and layout of your report to get it exactly the way you want.
  • It is easy to extract data as well as export the SSRS report to a different format like word, excel, CSV, pdf, XML, etc.
  • Delivery reports in multiple formats automatically (Scheduling via Subscriptions).
  • There are some limitations for CRM Online reporting which has mostly to do with limitations of Fetch XML.

Interactivity and Data Exploration is where Power BI wins over SSRS à

  • For interactivity and data exploration we can use parameters, drill-through reports or action links, however, comparing this to Power BI, it is very limited, if we click on a visual, all of the other visuals automatically cross-highlight or cross-filter.
  • Advanced Visualisation support in Power BI.
  • Because of the limited interactivity, SSRS is not ideal for data exploration. We have limited options for slicing and dicing the data. SSRS makes more sense when you know what you want the end result to look like. If you to play around with the data, you are much better off with Power BI.
  • Mobile support is much better for Power BI.
  • Support a large number of data sources.

In short, both the tool can be used and can co-exist as they fulfil a different set of requirements.

Would appreciate if you could provide your thoughts in the comments and some additional points.

Hope it helps..

What is the maximum file size limit for Attachments in Dynamics 365 \ On Premise V9?

Recently was trying to figure out the maximum file size limit for the attachments.

It is 131072 (in kilobytes)

Can be defined at Settings – Administration – Email Tab.

Scroll down to Set file size limit for attachments section

MaxSize

Hope it helps..

Using SARIF Viewer to read the static analysis results generated by Microsoft.PowerApps.Checker.PowerShell module

In the last post, we saw how we can use the Microsoft.PowerApps.Checker.PowerShell module to analyze the Solution (Unmanaged and Managed – Online or On-Premise) outside the PowerApps Maker Portal.

https://nishantrana.me/2019/07/12/using-the-powerapps-checker-powershell-module-to-validate-the-solution/

The reports generated by the tool are in SARIF format i.e. Static Analysis Results Interchange Format (JSON based) standard for the output format of the static analysis tool. This format originated at Microsoft.

To view the result, we can use the below tools

For Visual Studio :

After installing the extension, navigate to Tools à Import Static Analysis Log files for Error List à Import SARIF file and select the result file generated.

It will list down the details in the Error List Window as shown below.

For Visual Studio Code :

For Visual Studio Code, after installing the SARIF Viewer, simply open the file

Below is how the result is displayed in the UI inside Visual studio code.

Hope it helps..

Using the PowerApps checker PowerShell Module to validate the solution

Using PowerApps Checker PowerShell Module we can perform the solution check functionality from outside the PowerApps Maker Portal. This can be useful for automated build and release pipelines. Apart from that some of the notable capabilities of the module include

  • Support for both managed and unmanaged solution.
  • Support for On-Premise.
  • Support for more than one solution at a time.

To get started à

Open the PowerShell (as administrator) and install the module

  • install-module Microsoft.PowerApps.Checker.Powershell

Next, we need to register an Azure Active Directory application in a tenant with PowerApps or Dynamics 365 licensing, even if it is on-premise environment (solution) against which we want to run it.

  • Login to Azure Portal

https://portal.azure.com

  • Click on New registration to register a new application

  • Provide the below details

Redirect URI

  • Type: Public client (mobile & desktop)
  • Redirect URI: urn:ietf:wg:oauth:2.0:oob

Copy the values of Application id and Directory (tenant) Id which we will use later and click on View API Permission to give the required permission to the app.

Click on Add a permission (we’d see Sign and read user profile added by default)

API level permissions to the PowerApps-Advisor first party Microsoft AAD application

  • Application permissions to Analysis.All

Permissions à

PowerApps solution checker uses Solution checker rule set. Here we are getting all the rulesets available passing our tenant’s id.

  • $rulesets = Get-PowerAppsCheckerRulesets -TenantId ‘290055c6-7eb1-4ec4-93e6-81f053d13f76’

We wil be using Solution Checker rule set here.

  • $rulesetToUse = $rulesets | where Name -EQ ‘Solution Checker’

Now let us run it against the Solution Zip file as shown below

  • $analyzeResult = Invoke-PowerAppsChecker –ClientApplicationId ‘48131848-3b81-44f7-a999-d8362b391f25’ –TenantId ‘290055c6-7eb1-4ec4-93e6-81f053d13f76’ –Ruleset $rulesetToUse –FileUnderAnalysis “C:\PowerApps\Test_1_0_0_1_managed.zip” –Output “C:\PowerApps\Result” -Verbose

Give the required consent

We can see the results download at the path specified

Result is in JSON format

IssueSummary to get the quick overview

Get all the details here

https://docs.microsoft.com/en-in/powershell/powerapps/overview?view=pa-ps-latest

Hope it helps..

Using PowerApps Solution Checker from the PowerApps maker portal

The PowerApps Solution Checker feature released for general availability on May 2019, can be used to perform static analysis of the Unmanaged solution for components like plugin, web resources, custom workflow activities and provide guidelines and recommendations around the issues found.

To get started à

Sign in to PowerApps maker portal

https://make.powerapps.com/home

Select the Solutions in the left navigation pane and click on Install to install the Solution checker.

Click on GET IT NOW from the AppSource, specify the instance and the PowerApps Checker Solution will be installed in that Instance.

This will install the PowerApps Checker solution for the selected instance.

After the installation is done, we’d see the Solution checker menu enabled for the unmanaged solution.

Click on Run to run the test

We can see the results in the portal and can download the same as shown below.

Result of running it against another solution in which we are still using Xrm.Page object model à

The results will be available in both Excel and CSV format on the download

csv à

Excel will include a report as wellà

In the next post, we will see how to use the PowerApps Checker PowerShell Module to validate the solutions.

https://nishantrana.me/2019/07/12/using-the-powerapps-checker-powershell-module-to-validate-the-solution/

Hope it helps..

Fixed – Package Deployer (USD) not connecting to CRM Organization

Hi, while trying to set up USD in the Dynamics 365 Online environment

We were facing the issue with the USD’s Package Deployer, after login, it was showing the Organizations but on trying to connect to them, it was again taking back to the login screen.

This was because we were using below old version of the Package Deployer

Dynamics365-USD-2.2.0.755-PackageDeployer

To get it working as suggested by Microsoft we had to update the registry and add the following key – “SchUseStrongCrpto

This makes the .NET application, in our case, the older version of the Package Deployer to use TLS 1.2 required for connecting to Version 9.0 of Dynamics 365.

After making the registry change, we were able to move forward.

We will not be facing the same issue with newer version of USD

https://community.dynamics.com/365/customerservice/b/unifiedservicedeskblog/posts/unified-service-desk-4-1-general-availability

Hope it helps.

Thanks Microsoft for the MVP (Business Applications) award once again!

Thanks Microsoft for this recognition and thanks to all the wonderful and passionate Dynamics 365 (CRM) professionals who have inspired and motivated me and others for several years, to keep learning and contributing in the community and to grow in the process!

How to – Add Style to Custom Component in PowerApps Component Framework

Kindly refer the previous post, here we will be adding style to the component created in the post.

https://nishantrana.me/2019/06/06/step-by-step-create-a-very-simple-powerapps-custom-component-to-show-the-guid-of-the-record/

Let us continue with our previous sample component and try adding style to it.

  • Open ControlManfiest.Input.xml and specify the CSS file to be referred.

  • Uncomment the CSS tag in the manifest and create a new folder named CSS and place the CSS file there.

  • Edit the index.ts file and add the class to the label

  • Edit the CSS file

  • Edit the version number in case of updating the existing control in ControlManifest.Input.xml

  • Followed by the build command
  • npm run build


  • After the successful build, we can see the CSS added in the out folder for the component


  • Run the MSBuild command to generate the new solution zip files



  • Import the managed solution.
  • Open any of the existing contact records, we can see the style is applied to the control.

Hope it helps..

Step by Step – Create a very simple PowerApps Custom Component to show the GUID of the record

Go through below articles to get a better understanding

Below is the quick step by step guide to get started (sort of Hello World example) 

  • Install NPM (that comes with Node.js)

https://nodejs.org/en/

http://download.microsoft.com/download/D/B/E/DBE69906-B4DA-471C-8960-092AB955C681/powerapps-cli-0.1.51.msi

  • Install Visual Studio 2017 or later or Download .NET Core 2.2 along with Visual Studio Code.
  • Create the new folder for the project, and in Developer Command Prompt for VS 2017 navigate to the folder and run the below command to create a new component project

pac pcf init

– -namespace <namespace for the component>

– -name <name of the component>

– -template <component type>


It adds the following files in the folder.


  • Next run npm install command to install the project dependencies.

  • Open the ControlManifest.Input.xml file created inside the folder created with the control’s name.

  • Here we have opened it in Visual Studio Code, for this simple example purpose let us not change the default values.
  • Open the index.ts which wherein we’d be writing code for our custom control

  • Add the following line of code to add a label control that will display that GUID of the record.

  • Run npm run build command to build the control

  • To test the control run npm start command

*Use ctrl + c è to terminate the job.

  • Create a new folder to hold the solution

  • Run the below command to define the publisher name and prefix and initialize the solution files creation

pac solution init – -publisherName [publisher name] – -customizationPrefix [publisher prefix]

  • Run the below command to add reference to our custom control in the solution

pac solution add-reference – -path [path to pcfproj file]

i.e. reference of the below path.

  • This creates the file with extension cdsproj

  • To generate Zip File run the below command in the Developer Command Prompt for Visual Studio 2017
    • MSBUILD /t:restore
    • MSBUILD

  • This adds the Solution zip in the bin Debug folder.

  • To get both managed and unmanaged solution, update the cdsproj file

  • We can see both managed and unmanaged solution created.

  • Import the solution in Dynamics 365 CE and open any of the entity’s form. Here we have created a new text field named GUID in the Contact form and have set our custom control for that field.

For reference à

  • After publishing the changes, we can see the GUID being displayed in the form.

  • To update the control, change the version for it in the ControlManifest.Input.xml

Followed by

  • npm run build
  • msbuild
  • Importing the new solution file generated

In a nutshell below are the high-level steps à

1. Install npm

2. Install PowerApps CLI

3. Install Visual Studio 2017 or later

4. Create a new folder for the project.

5. Navigate to the folder in Developer Command Prompt and run the following command to create the component project

pac pcf init –namespace <component namespace> –name <component name> –template <component type>

6. Install the project dependencies using below command

npm -install

7. Update ControlManifest.Input.xml

8. Update index.ts

9. Build the project

npm run build

10. Use the below command to test the component

npm start

11. Create a folder for holding the solution zip and related files. Navigate to that folder and run the below command.

pac solution init – -publisherName [publisher name] – -customizationPrefix [publisher prefix]

12. Add reference of the custom component in the solution

pac solution add-reference – -path [path to pcfproj file]

13. To create the Solution Zip File

MSBUILD /t:restore

MSBUILD

14. Import the solution file and use it inside Dynamics 365 CE.

 

lastly – Don’t forget to check the wonderful PCF Gallery

https://pcf.gallery/

Hope it helps..