Check Dynamics 365 App and Power Platform features availability at different geography


Recently we had to find out what all Dynamics 365 Apps and Power Platform features are available in our UAE region.

To get these details navigate to

https://dynamics.microsoft.com/en-cy/geographic-availability/

and open the report

Below are the different Products and Geography available.

Below is the report filtered for UAE for Power Platform.

For Dynamics 365 App

Hope it helps..

Using Data Anonymizer component (SSIS) to mask data in Dynamics 365


At times to ensure compliance, we need to mask the data, especially in our sandbox environments, while still maintaining the structure of the data.

Here we can make use of the Data Anonymizer component of KingswaySoft’s SSIS productivity pack to mask the existing data.

Create a new SSIS package, add CDS Source, Data Anonymizer, and CDS Destination component.

CDS Source and CDS Destination are connected to the same sandbox environment where we are going to mask the data.

We have selected email address1, mobile phone, website URL field of Contact entity to be masked in CDS source along with contactid primary key to be used for Upsert action in CDS Destination.

Open the Data Anonymizer component and specify the property for each of the fields.

Email Address 1 –

Select Anonymization Type as Email (Personal)

Mobile Phone –

Select Anonymization Type as Regex and specify the Pattern for the Regex.

URL –

Select Anonymization Type as URL

Inside the CDS Destination component, select Upsert Action with matching Criteria as Primary Key as we are using contactid.

Map the fields

Execute the package

We’d see the updated contact records inside Dynamics 365

Get all the details of Data Anonymizer Component here

https://www.kingswaysoft.com/products/ssis-productivity-pack/help-manual/data-generation-and-anonymization/data-anonymizer

Here are few other articles on SSIS (KingswaySoft)

https://nishantrana.me/2018/11/26/ssis-and-microsoft-dynamics-365/

Hope it helps..

Different ways of getting record count (total) in Dynamics 365


Let us take a scenario, where a data migration package is running, and it either creates or updates (or deletes) a large number of records into Dynamics 365, and we want to get the count of records created/updated/deleted in the last x hour or so.

With views, we are limited to just 5000 records.

One option is to write the console app having the required QueryExpression or FetchXML condition using the Dynamics 365 SDK to get the count.

We can also make use of SSRS reports here.

Create a report using the report wizard, specify the criteria

In the LayOut fields window, specify Count as the summary type for grouping.

Run the report to get the count.

Another option that we have used the most is to use the FetchXML
Builder
plugin to build the query, copy it.

And use it in the FetchXML / View Record Counter plugin of XrmToolBox.

Select the entity, contact, in this case, paste the FetchXML query and click Execute Count.

We will get the count.

Along with FetchXML / View Record Counter we can also use
SQL 4 CDS plugin.

Within the FetchXML builder click on Edit in SQL 4 CDS button.

The result

And now with CDS T-SQL endpoint (preview), we can use SQL Server Management Studio as well to directly write the T-SQL instead of fetch xml

https://nishantrana.me/2020/05/21/setting-up-using-sql-to-query-data-in-dynamics-365-preview/

We can also use the CDS T-SQL endpoint within the SQL 4 CDS Plugin.

https://markcarrington.dev/2020/05/24/sql-4-cds-2-1-0-the-t-sql-edition/

What if we want total record count for an Entity?

Apart from all the methods above,

  • we can use Record Counter XrmToolBox Plugin for that

https://www.xrmtoolbox.com/plugins/AndyPopkin.RecordCounter/

  • or use RetrieveTotalRecordCountRequest

https://dreamingincrm.com/2019/07/22/getting-entity-record-counts/

  • or use Count aggregrate function

https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg309565(v=crm.8)?redirectedfrom=MSDN#count

however, it will fail in case of more than 50000 records


‘AggregateQueryRecordLimit exceeded. Cannot perform this operation.’

To increase the limit (on-premise)- https://nishantrana.me/2012/09/06/aggregatequeryrecordlimit-exceeded-cannot-perform-this-operation/

  • Will returntotalrecordcount property of FetchXML help ?


It will be helpful if total records are less than 5000.


Hope it helps..

Using Data Spawner component (SSIS) to generate sample data in Dynamics 365


At times we need to generate sample data for our entities in Dynamics 365 for various reasons, performance testing is one of them.

Data Spawner component which is part of KingswaySoft’s
SSIS Productivity Pack provides us the most efficient way of doing so.

Download the component here –

https://www.kingswaysoft.com/solutions/ssis-data-generation-anonymization-components/data-spawner-component

Let us generate the sample data for Contact Entity.

Add the Data Spawner component to the Data Flow along with the CDS Destination component in the integration service project.

Double click the Data Spawner to open the editor.

Click on Add + button to specify the columns, here we have specified four different columns.

We have kept the name for each of the columns, same as the schema name so that it is easy to map them in CDS Destination.

For the First Name column, we have specified Data Type as nvarchar and Spawn Type as the First Name, which will generate the string similar to first name value.

In Gender property for the First Name column, we can specify either to generate Male or Female first name.

Random will generate both Male and Female first name.

For the email address field, we have selected Spawn Type as email (personal), the other option is email (business).

For our option set field preferred contact method, we have selected data type as an integer and Spawn Type as Custom, which will allow us to specify the list of available values, which is 1 to 5 in our case.

We have specified the total number of records to be generated as 100000.

Lastly, we have set the output of Data Spawner to the CDS Destination component. (use the Map Unmapped fields to auto map the fields as we have set the column name same as the schema name of the attributes)

Execute the package

We can see our sample contact records start getting created.

Read more about Data
Spawner

https://www.kingswaysoft.com/products/ssis-productivity-pack/help-manual/data-generation-and-anonymization/data-spawner

Here are few other articles on SSIS (KingswaySoft)

https://nishantrana.me/2018/11/26/ssis-and-microsoft-dynamics-365/

Hope it helps..

Get User’s last logon time in Dynamics 365


We can get the different metrics about the usage of the platform like active user usage, the operation performed, the entity used, plugins and API statics, etc. through Command Data Service Analytics (formerly Organization Insights).

https://admin.powerplatform.microsoft.com/analytics/d365ce

These reports can also be downloaded.

Some of these details can also be captured by enabling Audit user access.

And navigating to Audit Summary View

This view can be filtered to show only the User Access via Web event to get the last logon details for the users.

We can use below FetchXML query to get the same details

<fetch mapping=’logical’ aggregate=’true’ version=’1.0′ >
<entity name=’audit’ >
<attribute name=’createdon’ alias=’LastLoginDate’ aggregate=’max’ />
<filter>
<condition attribute=’operation’ operator=’eq’ value=’4′ />
</filter>
<link-entity name=’systemuser’ from=’systemuserid’ to=’objectid’ alias=’su’ link-type=’inner’ >
<attribute name=’fullname’ alias=’fn’ groupby=’true’ />
<attribute name=’domainname’ alias=’dn’ groupby=’true’ />
<attribute name=’userlicensetype’ alias=’ult’ groupby=’true’ />
<attribute name=’accessmode’ alias=’am’ groupby=’true’ />
<attribute name=’isdisabled’ alias=’id’ groupby=’true’ />
</link-entity>
</entity>
</fetch>

We can also run the following SQL Query (in case of on-premise) to get the details


SELECT su.fullname,
su.domainname,
su.userlicensetype,
su.accessmode,
su.isdisabled,
max(a.createdon) AS LastLoginDate
FROM audit AS a
INNER JOIN
systemuser AS su
ON su.systemuserid = a.objectid
WHERE a.operation = 4
GROUP BY su.fullname, su.domainname, su.userlicensetype, su.accessmode, su.isdisabled;

Now there could be some users who have never accessed the application, to get details of those user we can use the below query


SELECT su.fullname,
su.domainname,
su.userlicensetype,
su.accessmode
FROM systemuser AS su
WHERE su.systemuserid IN (SELECT systemuserid
FROM systemuser
EXCEPT
SELECT DISTINCT objectid
FROM audit
WHERE operation = 4);

We can also use the wonderful User Audit Viewer XrmToolBox Plugin for getting the user audit details.

Can we use the new SQL Data Connection for CDS (preview) to query Audit information ?

We cannot as the Audit Table is not available

Audit

Hope it helps..

Setting up – Using SQL to query data in Dynamics 365 (Preview)


Recently we were trying out the preview feature of using SQL to query CDS data.

Below are the steps à

To get started,

Download or open SQL Server Management Studio (18.4 or later)

Use Azure Active Directory authentication to connect.

Specify the organization address URL followed by port 5558 in the server name.

If you get the error “TDS protocol endpoint is disabled for this organization”, follow the below steps to enable the TDS i.e. Tabular Data Stream.

Enable the TDS endpoint (preview)

https://docs.microsoft.com/en-us/power-platform/admin/settings-features

enableTDS

 

enableTDS

or

Download the OrgDBOrgSettingsTool i.e. CRM2016-Tools-KB4046795-ENU-amd64

https://www.microsoft.com/en-us/download/details.aspx?id=56131

Make the following changes in the configuration file of the tool

Highlighted in green

Run the below command (& enter the password for the admin account specified)

Microsoft.Crm.SE.OrgDBOrgSettingsTool Update /u <org-unique-name> EnableTDSEndpoint true

Get the organization unique name from Customization à Developer Resources

After making the above changes, we were able to connect successfully.

This is a definitely one of the most pleasing additions to the product !

Also check out the wonderful XrmToolBox plugin SQL 4 CDS

and

Skyvia Query 

for running SQL query against Dynamics 365.

Hope it helps..

Data Migration in Dynamics 365 – Key considerations


I was recently watching the FastTrack TechTalks on Data Migration.

https://community.dynamics.com/365/b/techtalks/posts/data-migration-january-16-2018

Below are some of the key points from the session à

Customer 360 View is more often than not, the starting point of the data migration discussions. Storing all the data in Dynamics 365 might not be a good idea as it could impact the performance and more importantly, the storage has a cost associated with it.

Learn more about the storage in Power Platform here

https://docs.microsoft.com/en-us/power-platform/admin/whats-new-storage

Important Considerations as part of the Data Migration Strategy

Data Source

  • What is the source of the migration? Is it a single system or multiple systems from which the data needs to be consolidated.
  • The appropriate connectors or technology needed to fetch or extract the data from the source system(s). (SQL, File-based, Web Service, etc.)
  • Need for a staging database for transformation and cleansing of data before migrating it to Dynamics 365.
  • Having a well-defined Dynamics 365 data dictionary and model.

Data Cleansing

  • Removal of the old data.
  • De-duplicate of the data.
  • Checking for null, missing required fields and references.
  • Identify and define the uniqueness of the record.
  • Need for defining Alternate keys

Data Transformation (mapping with Dynamics 365 entities and fields)

  • Transform the data to adapt to the target Dynamics 365 Data model.
  • Format and Range of the fields.
  • Calculate or combination of different fields.
  • Filtering and Enriching of the fields

Mapping OptionSet in KingswaySoft SSIS Integration Toolkit for Dynamics 365

Mapping OptionSet in Scribe Online

Lookup and Cache Transformation component in KingswaySoft SSIS Integration Toolkitfor Dynamics 365

Data Loading

  • Is it one-time migration (plus delta load daily) or n times migration
  • Based on the time it takes, the batch can run over the weekend or after office hours daily.
  • Order of data load – Master \ Configuration Data à Parent records àChild records.
  • Use Create or Update whenever possible instead of Upsert.
  • For Inactive records, first, we need to create those records as active, associate any child records to it if any, before updating the status of the record.
  • Use multithreading and execute multiple requests.
  • Figure out the optimum batch size and thread.

Optimum batch size

For Upsert in KingswaySoft SSIS Integration Toolkit for Dynamics 365

For Delete in KingswaySoft SSIS Integration Toolkit for Dynamics 365

Volume

How many records are to be migrated and how much time will it take.

Storage / Scalability

Do we need all the data to be stored in Dynamics 365, or for Customer 365, can we leverage Power BI reports which could pull data from different data sources?

Do we need all the data for all the entities or last x months?

Compliance and regulations

We need to consider what information is allowed to be stored/accessed by the users in Dynamics 365.

Other key points

  • Use WebAPI for migration.
  • Use Execute Multiple for batch operations.
  • Leverage Application User that provides Server to Server authentication.
  • To update CreatedOn field use OverriddenCreatedOn field.
  • Use Create OnBehalfOf / CallerID for Created By field.
  • Map ModifiedBy and ModifiedOn to custom fields for the historical purpose.
  • Check for the sequence of the auto-number fields in the entities.
  • If possible for improved performance – during migration disable duplicate detection, workflows, plugins, audit, activity feeds, etc.
  • Leverage the same location/region for running the package as the Dynamics 365.
  • For faster date-time conversions set regional settings to UTC for the service account being used.

Check out the below articles

https://kunaltripathy.com/2019/06/04/dynamics-365-data-migration-demystified-part-i/

Hope it helps..

Dynamics CRM On-Premise to Online Migration Program – Microsoft FastTrack


Customers planning to migrate to the cloud should check out the below session, as part of FastTrack TechTalks, on Dynamics CRM On-Premise migration to Online.

https://community.dynamics.com/365/b/techtalks/posts/onpremises-to-online-migration-program-january-17-2020

Highlighting some of the main points

  • FastTrack Service is only available for eligible customers. Check the eligibility requirements below

https://docs.microsoft.com/en-IN/fasttrack/M365-eligible-services-and-plans

  • The customer \ partner will be guided and assisted by FastTrack Solution Architect as part of the FastTrack Program.
  • Supported SQL Server version – 2008, 2012, 2014, 2016.
  • Supported CRM On-Premise – 2011, 2013, 2015, 2016, 9.0.

High-level steps of the program include

  • Setting up the migration project in Microsoft Lifecycle Services, which uses the wizard-based hosted tool for the migration.
  • Setting up Azure subscription and storage account (for which customer needs to pay along with the Dynamics 365 Subscriptions) and provision staging sandbox environment.
  • Taking the backup of the CRM On-Premise database and uploading it to Azure Blob Container.

    The backup is restored in the same version in Azure Hosted Virtual Machine i.e. CRM 2015 database will be restored in CRM 2015 VM.

  • PowerApps Checker service runs as part of the next phase, to validate the solution.
  • Finally, the Upgrade process starts, which upgrades the restored CRM Database to CRM 9.0 Database. E.g. CRM 2015 Backup will be restored in CRM 2015 VM, which will be then upgraded to CRM 2016 VM, and then finally to CRM 9.0 VM.
  • This is followed by user-mapping and the migration to the online as the last step.

Here, the customer/partner needs to make sure to transform all SQL Based report to Fetch XML, update the plugin to run in sandbox mode, update JavaScript to the new client object model, check for any 3rd part tools and reconfiguration of integration, make users familiar with new Unified Client interface, cleaning of the database (for audit data), etc to make the solution online compatible. This can be done before restoring to the Azure Storage or during the staging phase (This is customer/ partner responsibility and will be assisted by FastTrack Architect and Microsoft Technical Support team for any upgrade issues).

Hope it helps..

Notes on Dynamics 365 for Phones and Tablets app – Part 12 (Mobile Offline Capabilities and Limitations)


Check the other articles of this series.

In this post, we’d cover some of the limitations and capabilities of Dynamics 365 Mobile App (in offline mode)

  • Add Existing (n-n relationship) is not supported in mobile offline
Mobile App – Online Mobile App – Offline
  • Only System Views are available in offline mode.

“My Custom View” is public view which is available in online mode, but not in offline mode.

Mobile App – Online Mobile App – Offline
  • BPF is not available in offline mode.
Mobile App – Online Mobile App – Offline
  • Custom Ribbon Button are note available in offline mode
Mobile App – Online Mobile App – Offline
  • The mobile offline is only available in iOS and Android phone and tablet app. Below is the screenshot of Tablet App on Windows 10. There is no option for going offline.

  • The offline option in Phones App for Android

  • Business Rules work in Offline mode.
  • Plugins and workflows are not supported in Offline mode.
  • Use Xrm.WebApi.offline to perform CRUD operation offline.


Mobile App – Online Mobile App – Offline
  • Downloading offline updates can take a few minutes to an hour. (The user can still work online while the data is getting synced in the background)



  • Web Resource can be made available offline



Mobile App – Online Mobile App – Offline

The same web resource when defined within the sitemap gives a “No data available” message.


Mobile App – Online Mobile App – Offline

Thus, while designing a solution for Mobile Offline, we need to consider the above behavior of the mobile app.

Hope it helps..

“Enable for mobile” is now “Enable for Unified client”


Just sharing my quick observation –

Enable for mobile”  option for an Entity

EnableForMobile

is renamed to “Enable for Unified Client

EnableForUnified

Notes on Dynamics 365 for Phones and Tablets app – Part 11 (Mobile Settings)


Check the other articles of this series

In this post, we’d look at the different settings specific to the mobile app and their effect.

In the mobile app, navigate to Settings – Mobile Settings in Dynamics 365 for Phones app.

Below are the different settings available inside the mobile app.

Let us look at the behavior of each of these properties.

  • Offline Sync

Offline Sync option is only available for iOS and Android Devices

Enabling the offline sync option will start the sync process in the background and will download the data offline for the user. While sync is happening, users can keep working online.

After the offline data is downloaded users can enable the option “Work in offline mode” to work offline.

  • User content and location

This option allows users to take voice notes and attach it as an attachment to notes.

The location details can be used in the getCurrentPosition method of Xrm.Device

https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-device/getcurrentposition

  • Camera – Allow Access

It allows the user to take a picture through the camera and attach it to notes as an attachment.

To take Video and attach it to notes, both the below permissions are required

  • User Content and Location
  • Allow Access

  • Camera – Save photo to the library

This will save the picture taken through Camera in the Gallery. (doesn’t need User Content and Location permission)

  • Camera – Photo Resolution

It allows the user to specify the resolution of the picture taken through the camera.

Below were the findings of the size of the picture for different resolutions with different devices.

You can read more about the file size of the pics in mobile apps here

Thus we saw the different mobile settings available in the mobile app and their consequence.

Hope it helps..

Dynamics 365 for Phones and Tablets App posts


Notes on Dynamics 365 for Phones and Tablets app

Using Xrm.Device captureImage method to take a picture and attach it to notes.

Using Xrm.Device pickFile to attach files to notes

Fixed – You do not have any apps in this view error.

Upload files using SharePoint integration in mobile app

Calling SetWordTemplate from the custom ribbon button

Attachment to Notes in the mobile app

Notes on Dynamics 365 for Phones and Tablets app – Part 10 (Data Download Filter in Mobile Offline)


Check the other articles of this series

In the previous posts, we saw how to configure Mobile Offline Profile and how it works for the end-users in the device.

The number of records that can be downloaded for Mobile Offline for a particular entity (and its related entity) can be specified using the Data Download Filter of Mobile Offline Profile Item record.

The total data available offline to the user will depend on Entity (enabled for offline) + Organization Data Filter applied to it + Mobile Offline Profile + Security roles of that user

Navigate to Settings à Mobile Offline à Mobile Offline Profiles

Let us open the Contact Mobile Offline Profile Item that we had specified earlier.

The different options for Data download filter are

  1. All records

Here All records will apply no filtering and all the contact records will be downloaded offline for the configured user.

The one important point to remember is that à

The total entity records (contact in this case) downloaded will be governed by the Organization Data download filter for that entity, what we specify in the mobile offline profile (i.e. data download filter) will be applying further filtering to it.

For contact, the criteria specified is Status equal
to Active.

Organization Data Filter criteria would be modified on less than 10 days for most of the entities by default


So, for All Records, we will have all the active contact records downloaded offline.

On publishing the above mobile offline profile, for users in offline mode, all the active contacts will be available.

And no inactive contacts will be available as shown below.

  1. Other data filter

Through Other data filter, we can specify what records to be downloaded based on ownership.

Here we have just selected Download my records, which should result in only the active (coming from organization download data filter) contacts owned by the user to be downloaded.

Let us publish it.

After successful Publish, let us check the same in the Phone App.

The app shows only the active contact records owned by the user.

Active Contacts view for the same user in Web Application.

  1. Custom data filter

The custom data filter will allow us to define the filter using the Define Profile Item Entity Filter dialog box.

Clicking on Define Filter Rule opens the dialog box for us, wherein we can select the fields of the entity for defining the filter criteria and can group it. We cannot choose related entity fields there.

Here for testing, we have kept the criteria as role equals as the Decision-maker.

Now let us publish the change, and check the data for the user in the mobile app offline.

We just have just one record having a role as the Decision-maker.

Back in the mobile app, the user can see only that one record inside the app.

  1. Download related data only

This option allows us to download related entity data. E.g. with the above contact records, we want to download the related lead records only, for this we will create a new profile item for the lead entity.

Now back in the Contact profile, add an associated offline profile item and specify the Entity-relationship between contact and lead.

Let us publish this new profile.

The user can now select the contact record and can see the related lead record

What happens if we delete the Lead Mobile Offline Profile and only keep the Contact offline profile having the lead association to it?

We’d get the below error

What happens if we keep the contact and lead profile and delete the lead association in the contact offline profile?

This will allows us to publish the profile.

So, for contact we have

  • Org filter as active contacts.
  • Data download filter as – Custom Data filter as Role equals Decision maker.

And for lead we have

  • Org filter as active leads.
  • Data download filter as – Download related data only.

The result – only one contact record with a role as the decision maker will be available for the user.

No associated lead

And no leads

Let us add back the mobile offline profile item association record of the lead in the contact offline profile.

The result à only one active contact record having the role as a decision-maker, and only one associated lead record will be available for the user.

Thus we saw, how we can use Data Download Filter to define filtering, which would specify the total records that would be available to users offline, in the mobile app.

Hope it helps..

Using Xrm.Device pickFile to attach file to notes in Dynamics 365 for Phones and Tablet app


Check the other articles of this series

In the previous post we covered the captureImagemethod of Xrm.Device for taking picture and attaching it to notes.

In this post, we’d look into the pickFile method of Xrm.Device

pickFile works for both Web Client and Mobile Client unlike captureImage which is only works for Mobile Client (Dynamics 365 for Phone and Tablet app)

pickFile method of Xrm.Device allows us to select files from the computer (web client) (through FileDialog box) and images (gallery) in the case of mobile clients. (the exception being Windows Tablet App), which then can be attached to notes.

Here we have added a custom ribbon button named “Pick file and attach” on the Lead entity form.

In the case of Web Client, the File dialog box opens

In the case of Windows Tablet App also, the file dialog box opens.

For Phone App for Android (and iOS), users can select the existing image from the gallery.

On successful attachment of file/image to notes, the user is presented with the below message.

Users can refresh the timeline to see the attached file.

The sample code using the pickFile method


function PickFile(entityId) {

entityId = entityId.replace(/[{}]/g,'');
Xrm.Device.pickFile().then(

function (data) {

// attach the uploaded file as attachment to note
var entity = {};
entity.subject = "Sample Subject";
entity.documentbody = data[0].fileContent;
entity.filename = data[0].fileName;
entity.mimetype = data[0].mimeType;
entity.notetext = "Sample Text";

// lead entity sample
entity["objectid_lead@odata.bind"] = "/leads(" + entityId + ")";

Xrm.WebApi.online.createRecord("annotation", entity).then(
function success(result) {
var newEntityId = result.id;

var alertStrings = { confirmButtonLabel: "OK", text: "File successfully attached to note. Please refersh the timeline." };
var alertOptions = { height: 200, width: 300 };
Xrm.Navigation.openAlertDialog(alertStrings, alertOptions);

},
function (error) {
Xrm.Utility.alertDialog("Error occured while attaching file to notes. Please try again");
}
);

},
function (error) {
Xrm.Utility.alertDialog("Error occured while picking file. Please try again");
}
);
}

Add the Crm Parameter to pass the GUID of the record to the method.

Thus, using pickFile makes it easy for the end-user to capture and attach the file to notes through a click of a button.

Also check out the wonderful tool Notes Metadata Manager , which provides additional capabilities like adding metadata to the attachments, organise attachments using folder structure, drag and drop attachments, upload multiple attachments etc.

Hope it helps..

Using Xrm.Device captureImage to take picture using camera and attach it to notes in Dynamics 365 for Phones and Tablet App


Check the other articles of this series

captureImage method of Xrm.Device allows us to take the picture through the camera and work with that captured image in the code (in this post, we are saving the image in the notes as an attachment).

This method is only available for mobile apps.

Here we have added a custom ribbon button on the Lead entity form.

  • Capture and attach

The capture Image method will allow the user to capture an image using the device camera and attach it to the notes as shown below.

Clicking on “Capture and attach” ribbon button, opens the camera for the user to take the pic as shown below.

Clicking on OK will ask the user to choose the image editor.

Users can edit the image and click on done.

The dialog informs the user that images have been attached.

Users can refresh the timeline to see the attached image in notes.

If we try using the captureImage method inside the Dynamics 365’s web application, we get the below error, because it is only supported for mobile devices.

The method will throw the below error in case of Web Application

“Operation {0} is not supported by platform”

The sample code for captureImage


function CaptureImage(entityId) {

entityId = entityId.replace(/[{}]/g,'');

var imageOptions = {};
imageOptions.allowEdit = true;

Xrm.Device.captureImage(imageOptions).then(
function (data) {

// attach the captured image as attachment to note
var entity = {};
entity.subject = "Sample Subject";
entity.documentbody = data.fileContent;
entity.filename = data.fileName;
entity.mimetype = data.mimeType;
entity.notetext = "Sample Text";

// lead entity sample
entity["objectid_lead@odata.bind"] = "/leads(" + entityId + ")";

Xrm.WebApi.online.createRecord("annotation", entity).then(
function success(result) {
var newEntityId = result.id;

var alertStrings = { confirmButtonLabel: "OK", text: "Image successfully attached to note. Please refersh the timeline" };
var alertOptions = { height: 200, width: 300 };
Xrm.Navigation.openAlertDialog(alertStrings, alertOptions);

},
function (error) {

Xrm.Utility.alertDialog("Error occured while attaching image to notes. Please try again");
}
);

},
function (error) {
Xrm.Utility.alertDialog("Error occured while capturing image. Please try again");
}
);
}

Add Crm Parameter to pass the GUID of the record to the method

CaptureImage

Thus, using captureImage makes it easy for the end-user to capture and attach the image to notes through a click of a button.

To update an entity’s image, we can click on the image itself which will open up the dialog to either use the camera, upload image from the gallery, or revert it to the default image (in not default).

Also check out the wonderful tool Notes Metadata Manager , which provides additional capabilities like adding metadata to the attachments, organise attachments using folder structure, drag and drop attachments, upload multiple attachments etc.

Hope it helps..

Your solution is too large. Reduce the number of entities to 5 or less message while publishing through Ribbon Workbench


To begin with, Ribbon Workbench is easily one of the best tools out there for CRM professionals for almost a decade now.

In CRM 4.0, to add a custom button on the form, we simply had to add a tag in ISV.Config file.

https://nishantrana.me/2009/03/20/adding-custom-menu-and-button-to-custom-entity-through-isvconfig/

The first time I tried adding a button in CRM 2011 (while it was in beta), it took nearly 8 hours.

https://nishantrana.me/2010/11/04/adding-my-first-custom-button-in-crm-2011/

With Ribbon Workbench, it has all come down to a matter of minutes. Thanks to Scott Durow

While working with the tool recently, we were getting the following message repeatedly while trying to publish the changes

The first thing we need to make sure is we are only having the required entity and solution components in the solution that we are working with inside the tool as suggested.

https://ribbonworkbench.uservoice.com/knowledgebase/articles/169819-speed-up-publishing-of-solutions

If we are already following that, another thing that we can make sure is, before we start working with the already loaded solution, is to reload the solution before making any changes.

E.g. I had the solution already loaded in the tool, and now I after a couple of hours I am trying to update a few things in it.

Before making any change, click on the Open Solution and load the solution again.

Load the solution, make any desired change, and publish.

This way we were able to avoid the error during publishing (also it will make sure we are working with the latest solution)

Hope it helps..

An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail while trying to connect using XrmToolBox


While trying to create a new connection in XrmToolBox, we got the below error

We had used the Connection Wizard as the connection method

After failing a couple of more times, we realised the mistake.

For the user who is trying to log in, MFA is enabled.

So, instead we opted for the SDK Login control connection method.

Clicking Open Sdk Login Control button opens up the standard login control to connect to Dynamics 365.

Provide username, password, and click on login.

Enter the code (received on registered phone number).

Thus, using the SDK Login Control, we were able to connect successfully.

You can also connect by registering the Azure AD App

https://alphabold.com/connecting-to-mfa-enabled-microsoft-dynamics-365-using-xrmtoolbox/

Check the below article for further details and different ways to connect to Dynamics 365 using XrmToolBox

https://www.xrmtoolbox.com/documentation/for-users/connecting-to-an-organization/

Hope it helps..

Notes on Dynamics 365 for Phones and Tablets app – Part 9 (Mobile Offline)


Check the other articles of this series

Continuing our previous post, where we configured the entity for the offline, mobile offline profile, and also enabled the offline option for the app, in this post we’d see the behavior of the apps in the offline mode within the Dynamics 365 for Phones App.

On opening the app, the user for which the mobile offline profile is configured will be presented with the below option to download the data for offline.

Clicking on Download will start the download process.

Navigate to Settings à Offline Status (this status will only be added for the apps enabled for offline)

The Offline Status will show us the status of the download.

Once the download completes, we can see the Contact entity available and also the option of working offline enabled for it.

Enabling Work in offline mode, and navigating the dashboard displays the message as below

The phone app also shows the green connection symbol next to the contact entity.


Navigating to the Account entity (which is not configured for offline) shows the below message.


Navigating to Contact entity (configured for offline) displays the lists as expected.

Now let us open one of the records and update the value of a field in it.

Here we have updated the mobile phone number field.

Let us navigate to the Offline Status option and disable Work in Offline Mode.

We see the “The connection was successfully restored” message.

And also the record updated back in our Dynamics 365 Sales Hub App.

In this post, we saw the basic behavior of the phone app in the offline mode, in the next post, we will explore a few more features of the mobile app with regards to offline mode.

Hope it helps..

Fixed – “You don’t have any apps in this view” error in Dynamics 365 for Phones and Tablets


Check the other articles of this series

For one of the users, who had all the appropriate privileges and security roles to access the Sales Hub app, we were getting the below error.

In iPad à

In Dynamics 365 for Phone for Android à

As part of troubleshooting, we assigned the System Administrator role to the user, tried uninstalling and reinstalling the app, tried in a new device with the same user, but we were getting the same error.

Here we were entering the email account to login to the application.

Later when we tried the “Sign in with a web
address
instead” it worked for us.

It started showing the Sales Hub for the user.

It could be some intermittent issue or something to do with cache, cannot say for sure, would suggest trying out the same, if the user has all the appropriate rights on the entity and the app and is still facing this issue.

Hope it helps..

Notes on Dynamics 365 for Phones and Tablets app – Part 8 (Mobile Offline)


Check the other articles of this series

Continuing our previous post, here we’d cover the configuration steps and details around offline support for Dynamics 365 for Phones app.

To begin with,

The mobile offline is only available and is supported for iOS (>= 13.1904) and Android (> =4.3.19043) devices.

To enable an entity for offline, we need to check the Enable for Mobile offline option for it.

Below are some of the main entities for which we can enable the mobile offline option (along with newer entities added in the product and the custom entities)

Account Activity Pointer Appointment Attachment Case
Competitor Competitor Address Connection Connection Role Contact
Email Lead Opportunity Opportunity Product Phone Call
Position Product Task Team User

How much data is synchronized?

This is governed by
the Organization data download filter.


Select the entity enabled for Mobile offline and click on the link, and specify the filter

Next, we need to specify the Mobile Offline Profiles, navigate to Settings à Mobile Offline

Below are 2 profiles already available.

The sample sales scenario profile :

Let us create a new mobile offline profile, with add only the contact entity in it.

In the new mobile profile item record, we have selected Contact as the entity.

For Data Downloaded Filter we have 4 options as shown below

  • All records
  • Custom data filter
  • Other data filter
  • Download related data only

All records will download all the data without any filtering, for the user specified.

The ENTITY ORG FILTER will open the filter that was defined for the contact entity earlier.

Let us now add the users for the mobile offline profile.

Now let us Publish the profile.

Next, navigate to Settings – Advanced Settings – My Apps and open the model-driven app in the app designer.

In the properties tab, check Enable Offline profile and select the profile created for contact.

Now we are done with our basic setup.

In the next post, we’d see how all these configuration settings affect the end-user in the offline mode through Dynamics 365 for Phones App.

Hope it helps..

Accessing fields on QuickView Form (Control) through JavaScript in Dynamics 365


Suppose we have below Account’s Quick View Control on contact entity.

Now to access the email address attribute we can use the below Jscript on the Contact’s form onload event.

The result à email address field is hidden in the quick view form.

https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui-quickforms/isloaded

Hope it helps..

Book summary: PowerApps Portals Authentication


I recently read the kindle version of the book PowerApps Portal Authentication by Debajit Dutta and Chandana Kommuri.

The book covers in detail the different authentication methods available for the PowerApps Portals and also provides detailed instructions to set them up.

The different topics included in the book are

  • Local authentication – Self Registrations and Invitations.
  • External Authentication – with Google, Facebook, LinkedIn, Azure Active Directory (B2C and B2B)

This is the first and the only book in the market on PowerApps Portals, and I think it would be very helpful for the Dynamics 365 professionals, as authentication is the basic and most important piece of information needed while configuring PowerApps Portals for the customers.

What I like about the books in general is it gives us all the required information at the same place, instead of being scattered all around out there in the web, and also that information coming from the expert(s) who have been working on it (because of which you’d be buying the book in the first place) adds to its credibility. The book not only covers all the required details (how and why) for setting up the authentication but also presents it simply and concisely. The chapters start with how to register the portals with the external authentication provider, the authentication mechanism available, settings required in portals, etc. There is a specific pattern or consistency about the way chapters are written in the book, which will make it very easy to be referenced when required. Being around 150 pages, the book was also a quick read.

Grab your copy at the link below !

https://www.amazon.in/PowerApps-Portal-Authentication-Debajit-Dutta-ebook/dp/B085X2HL4W

Solved – window onload undefined error in Dynamics 365


Recently we got the below issue raised by the user on form load of one of the entities.


Most of the times this issue will arise because of the control / attribute being referenced in the JavaScript, being not available on the form.

And same was the case here, one of the JavaScript’s associated with the ribbon button, was referring to business process field (header_process_xxxxx) which was not available on the form.

Hope it helps..

Notes on Dynamics 365 for Phones and Tablets app – Part 7 (Custom Controls)


Check the other articles of this series

Continuing the previous post on the Dynamics 365 mobile app, here we will cover the custom controls.

Custom controls were added to the product in version 9.0 and were part of the new Unified Interface, for us to use at that time. Now we all can create custom control using PowerApps Component Framework (earlier known as Custom Control Framework).

Check out the PCF Gallery for all the custom controls developed by the community.

https://pcf.gallery/

In this post let us look at out of the box custom controls available in the product and how it renders within the Dynamics 365 for Phone App.

Let us start with the custom control for the list.

For the opportunity entity, we have defined below custom control. The Editable Grid option is disabled for Phone.

The tablet app shows the Editable grid as default with the option of switching the view.

For the Phone App, it seems Kanban’s view has some issues. We can switch to all other views configured except the editable which is not available for the phone app.



Below is the table that lists the out of the box custom control, along with its properties and how they are rendered in the phone app, for quick reference.

Field Type Control Property
Whole Number
&
Money
Arc Knob

Radial Knob
Number Input
Linear Gauge
Linear Slider
Whole Number Star Rating (max 5)
URL Website Preview
Multimedia
Boolean Flip Switch
Single line of text Input mask
Auto complete
Multiline of text Pen
Option set Option set (max 3)

Hope it helps..

Error – You have exceeded the maximum number of 2000 characters in this field while using Pen Control in Dynamics 365


We might get the below error while using the pen control.


Just make sure that we have set the field to the minimum length recommended by Microsoft i.e. 15000.


The maximum value that can be set for the text area (multiple line of text) field is 1048576.



Earlier pen control was not available for the Web client.

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/284081/can-t-check-pen-control-for-web-on-dynamics-crm-365/1036343#1036343

But now they can be enabled for the web as well.



Hope it helps..


Notes on Dynamics 365 for Phones and Tablets app – Part 6 (Form customization)


Check the other articles of this series

Continuing the previous post,

in this post, we’d see how we can configure the forms for mobile apps.

Here, for example, we have taken the Contact entity, which would have below main forms for the contact entity.

The same would be available for the user (with appropriate security roles) within the tablet app and phone app.

Now for Sections within in Form, we see the option “Available on phone”, let us keep it as unchecked.

The section would appear within the Tablet app.

The section will not be available for the Phone App users as the name of the option “Available on Phone” suggests.

“Available for phone” option is available for the Tabs as well.

This will hide the tab in the Phone App, but it will be available within the Tablet app.

Also, Microsoft document mentions that Duplicate Detection doesn’t work on phones and only works for tablets https://docs.microsoft.com/en-us/dynamics365/mobile-app/set-up-dynamics-365-for-phones-and-dynamics-365-for-tablets#other-differences-with- which doesn’t seem to be the case now.

The Duplicate dialog box works in case of both tablet and phone app. Below is the screen shot of the phone app.

Also, the documentation mentions that Activity Feeds are not available in Tablets but it seems that it now works for both tablet and phone apps.

With a Model-driven app, it seems most of the things are now consistent across the web, mobile and tablet app, with few exceptions, making it easy for both the admin and the end-users to configure and use.

Hope it helps..

Identify deleted entity and attributes in Audit Summary View – Dynamics 365


We recently had an issue where all the data for certain entities got deleted, which is only possible if that entity has been deleted, which could have been triggered by the deletion of the managed solution.

As it was on-premise, we started our analysis with the wonderful Solution History plugin of XrmToolBox.

The Solution History had the information of new managed solution being imported.

But it didn’t capture the delete event for the solution or the entities.

The good thing was that we had the audit enabled, which helped us to figure out the entities deleted and account that was responsible for this delete (accidental).

For online, it is straightforward to track the solution import and delete event, now with the Solution History available in the product itself.

Another thing to remember with regards to the deletion of the managed solution is,

If Solution A has entity A and entity B and this has been imported as managed in Production first, followed by Solution B that has entity A only.

If Solution B is deleted only Entity A will be deleted as entity B is still being referenced by Solution A.

Check the below blog post to understand the installation order and solution layering.

https://nishantrana.me/2018/11/11/installation-order-for-solutions-patches-in-dynamics-365-customer-engagement/

https://debajmecrm.com/2019/05/23/unearthing-solution-layering-feature-of-dynamics-365-how-are-the-good-old-concepts-of-patching-and-cloning-related-to-it/

Hope it helps..

Notes on Dynamics 365 for Phones and Tablets app – Part 5 (Dashboards)


Check the other articles of this series

Continuing the previous post,

In this post let us try configuring the Dashboard for mobile.

We have created a custom dashboard having the test entity and have kept the “Enable for mobile” option as unchecked

Now let us add this dashboard in our model-driven app and update the sitemap.

Publish the changes and open the app in the mobile app.

The Dashboard is available within the app, even though the option “Enable for mobile” was unchecked.

Here we need to make sure the user has the Dashboard is accessible for the security roles(s).

Some of the system dashboards will have “Enable for mobile” property already checked and greyed out.

As we already saw, this property doesn’t have any effect in the case of the model-driven app, so to make these dashboards available for the end-user, we just need to add them to the App.

The dashboard within the mobile app.

Now let us try adding an Interactive Dashboard to the app.

The Interactive Dashboard shows up within the tablet app for windows, with a horizontal scroll bar.

And the same inside the phone app for android, displayed vertically considering the screen size.

Now let us check the behavior with the personal dashboard.

Say e.g. user1 (system admin) has created the following personal dashboard named personal dashboard.

The same is displayed for the user within the mobile app.

As expected, it is not available to another user, considering it is a personal dashboard.

Let us share the dashboard and check.

The personal dashboard will be available to the user to who it has been shared.

It seems like with earlier version it was not possible

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/208534/crm-dashboard—viewing-shared-dashboard-on-mobile

Thus, we covered how to add the dashboards to the app and the way they render within the mobile app.

We have also shared our feedback on some of our findings on Microsoft docs

Hope it helps..