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..

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..

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 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..

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..