Its #FriYay! For every click saved in your work is a productive second put into good use!
From what I have seen, users expect to complete a certain operation in and around 2 clicks. For instance, consider assigning a record in CRM to another user/team – this would pretty much take 4 clicks. How can we simplify this to do the assign operation in just one click? How about a PCF control on an entity form which lists down all the users/teams in an autocomplete text box, where users could do a wildcard search from the list, further pick the assignee and just click on the control’s ‘Assign’ button? Sounds cool? See, we could assign a record in just one click 😀
Another PCF quickie before I go for lunch today 😛 A simple on-demand address data retrieval using Gothere.Sg API. Folks in Singapore, can make use of this 🙂 Embed the control on to the form and you’re good to go 😀
Always wondered if we indeed need a WhatsApp widget on customer form such that we can draft the message and send WhatsApp direct message to the customer right from the Customer form itself. Further you may also create a SMS activity for the same customer too.
Here in the demo, I’m making use of the free WhatsApp API to launch WhatsApp web and send the message.
N.B: For some reasons, the WhatsApp font awesome icon isn’t rendering with 500 GET error. But that can be sorted 😉
Its been a month since Microsoft announced about this, now it has been released for public preview. Do note that this is a preview feature and not meant to be used for production purpose.
The most commonly asked question after the advent of PowerApps is how do we take it to external users. Well, Microsoft heard you! PowerApps Portals is the answer for you 🙂
PowerApps Portals let you build low-code, responsive websites which lets external users to interact with the data stored in the Common Data Service and Dynamics 365 environments directly from https://make.powerapps.com
The template designs that come along with PowerApps portal are pretty much the liquid templates, thus, a developer with Dynamics Portal working experience will find the PowerApps Portal quite easier to customize.
Here in this blog which I will keep it very light – after setting up the PowerApps Portal, lets try to create a web page which connect to Contact entity (CDS) and lists all contacts. Let’s keep it real simple for now.
Select ‘Portal from blank (preview)’
Proceed to create the portal with a nice name 😛
You can see the progress right up there in the notification pane
It will take a while, it’s not very instant. You’ll get notified when it ready so that you don’t have to worry about refreshing the page to see the status 😛
Alas, the much much awaited portal is here
Yes, it’s responsive too.
Let’s do the customization and configuration of the portal
Clicking on ‘Edit (preview)’ takes you to WYSIWYG portal designer mode.
Let’s create new page by going to ‘New page’ -> ‘Blank Page’
Insert a List component on the page.
The list control is now added to the page.
Set properties to the list control as below:
Save the change and click on ‘Browse Website’. That’s a simple page creation to show list of contact.
You may play around with other properties bounded to the list control.
In addition this, we have Dynamics 365 Portal where in if your environment contains Dynamics 365 for Customer Engagement apps, you can create the portals mentioned in Portal templates.
Select the required portal template. The creation process is same as earlier what we did for PowerApps Portal for CDS.
The supported browsers currently are:
You may also choose to share or delete the portal. For sharing the portal to internal users, it is recommended to have a System Administrator or at least a System Customizer security role in the corresponding Common Data Service database.
Finally, you can create only one portal of each type in an environment per language. If you try to create more than one portal, you’ll see an error message as follows:
To create more portals, you must create a new environment using the create new environment link in the error message.
I hope this blog serves as a starting point to kick start your interest in PowerApps Portals whilst I try to explore more on the PowerApps Portal and keep sharing my knowledge here.
Developer command prompt of Visual studio 2017 or later
Step 1: Project setup
Open Developer command prompt of Visual studio 2017 or later
Navigate to any local directory
Run the below command:
pac pcf init –namespace <specify your namespace here> –name <put component name here> –template <component type> (do note there are two hyphens)
For instance: pac pcf init –namespace CaseTimerControl –name CaseTimerControl –template field
“namespace” is the namespace that you want to provide for
“componentname” is the name of the control. “template” – Being it a pre-release, only two values are supported for this – field and dataset
Project is now successfully created
Run the command “npm install” as advised. It will install all the dependencies
Dependencies are installed successfully
Your project folder will look like below:
Step 2: Setup Manifest file of the custom control
We will just focus on two files under the below folder.
Open the ControlManifest.xml in any suitable xml editor of your choice. I used notepad++
What does a Manifest file mean, it is a file which contains metadata of a control. For example, the files of a computer program may have a manifest describing the name, version number, license and the constituting files of the program.
The ControlManifest.xml file would look like below:
Let’s look at each xml tag in detail.
In the <control> tag:
1. The ‘namespace’ and ‘constructor’ share the same name of the framework project we created earlier.
2. ‘display-name-key’ – the display name which will appear for the control in CRM. I used ‘TimerControl’
3. ‘description-key’ – the description for the control while will appear in CRM. I used ‘TimerControl’ again.
The control tag in the xml file would now now look like:
Next, we need to set the properties for the control to which this control would be associated to:
I will associate the field type ‘SingleLine.Text’ for this control – meaning in CRM, for the field of data type ‘SingleLine Text’ – this custom control can be used.
In the <property> tag, below element signifies:
name – the name of the property
display-name-key – the name of the property which will appear in the CRM when this control is configured
description-key – Description for the property to appear in CRM
usage – three values are allowed: bound, input or output. It is used to determine if the property is meant to represent an entity attribute that the component can change (bound) or read-only values (input)
***Azure IoT Central (as defined by Microsoft) is a fully managed SaaS solution that makes it easy to connect, monitor and manage your IoT assets at scale. It simplifies the initial setup of your IoT solution and reduces the management burden, operational costs, and overhead of a typical IoT project.***
From the above words, it is quite evident that anyone with no background of coding can do a simple integration of MXChip – Azure IoT Central with Dynamics 365 Connected Field Service You can have look at http://mxchip.com/az3166 to know what capabilities the device can offer.
This is how a MXChip IoT DevKit – AZ3166 look like:
Using the MXChip IoT DevKit, monitor the surrounding temperature.
On the MXChip IoT DevKit, when we press button B – it will create a in IoT alert in Dynamics 365 Connected Field Service.
Let’s see how we can achieve this. Follow the steps below:
You can choose either ‘Trial’ or ‘Pay-As-You-Go’. Either plans will have its own capabilities. It’s obvious that ‘Pay-As-You-Go’ will need a valid Azure Subscription. For now, we’ll choose ‘Pay-As-You-Go’. Pay-As-You-Go applications are charged per device, with the first 5 devices free.
Select ‘Sample Devkits’ since we already have a MXChip device with us.
More info on application templates below:
Sample Contoso: Creates an application that includes a device template already created for a Refrigerated Vending Machine. Use this template to get started exploring Azure IoT Central.
Sample Devkits: Creates an application with device templates ready for you to connect an MXChip or Raspberry Pi device. Use this template if you are a device developer experimenting with any of these devices.
Custom application: Creates an empty application for you to populate with your own device templates and devices.
The Application name and URL are automatically generated.
Further, you need to select your Directory, Azure Subscription, and Region:
Directory is the Azure Active Directory (AD) to create your application. It contains user identities, credentials, and other organizational information. If you don’t have an Azure AD, one is created for you when you create an Azure subscription.
An Azure Subscription enables you to create instances of Azure services. IoT Central will provision resources in your subscription. If you don’t have an Azure subscription, you can create one on the Azure sign-up page. After you create the Azure subscription, navigate back to the Create Application page. Your new subscription appears in the Azure Subscription drop-down.
Region is the physical location where you’d like to create your application. Typically, you should choose the region that is physically closest to your devices to get optimal performance. You can see the regions in which Azure IoT Central is available on the Products available by region page. Once you choose a region, you can’t later move your application to a different region.
Once above 3 items are selected, click on ‘Create’
The Dashboard of Azure IoT Central is shown:
Go to ‘Device Explorer’, select ‘MXChip (1.0.0)’ and select ‘Real’
The device page with status as ‘Provisioned’ is shown. Now, click on ‘Connect’
The created device’s connection properties is shown as below. Copy down all the IDs to a notepad, you will need it later.
Step 3: Setting up the MX Chip
We need to load the IoT Central firmware to the MX Chip.
Connect the IoT device to your p.c (windows OS). It will open up in a separate disk drive with the device name AZ3166. Open the drive folder and copy the firmware file here.
The Azure IoT Central Device Config page is shown as below:
Click on the first dropdown item on the page to look for available Wifi connections for the IoT device to connect. For now, I will use my mobile HOTSPOT.
Device Pin Code: 4584 (as shown on the screen of IoT device)
Scope ID, Device ID, Primary/Secondary Key are available in the notepad, which you copied earlier. You can select ‘SAS Key’ and check ‘Temperature’ alone as we will only monitor temperature
Further, click on ‘Configure Device’.
Device configuration is now completed. It is not needed to press ‘Reset’ button as the page says.
Quickly look at the IoT device, it will be trying to connect to the Wi-Fi network you just configured.
Once connected, it will start to send the temperature data to Azure IoT Central.
To view the data, go to Azure IoT Central, select ‘Device Explorer’ -> MXChip (1.0.0) and select the MXChip with ID we just created.
Go to ‘Measurements’ tab, scroll down until you see ‘temperature’ and click on the eye icon (Visibility) to view the temperature data being streamed into Azure IoT Central from the IoT device. (In the pic below: hover the mouse cursor on the black line, 27.50 degrees is the temperature data being sent from the IoT device)
The device will keep sending the temperature data every 12 seconds to Azure IoT Central.
All good now. This covers scenario 1.
For scenario 2, if you look at the IoT device, there’s button with name ‘B’. When we press this, we create an IoT alert in CRM. To achieve this, IoT central has got its down Out-of-the-Box device templates.
Headover to Azure IOT Central -> Device Templates and select ‘MXChip’
Go to ‘Rules’ tab. Click on ‘New Rule’
Further, click on ‘Sample Rule’
For instance, give rule name as ‘Button B pressed’, make sure ‘Enable rule for all devices of this template’ is enabled. In the Conditions, choose ‘Button B pressed’.
Click on ‘Save’
So, when the button B is pressed, we need to create IoT alert in CRM. We will make use of Microsoft Flow for this purpose.
Under Actions -> Click on “ + “, scroll all the way down until you see ‘Microsoft Flow’
Microsoft Flow page is opened up (Note: If you are not signed-in, it may ask you to sign in, please do so). Click on ‘Explore Templates’.
Look for the flow ‘Create CFS Alerts from IOT Central’ and click on it.
Ensure both Dyanmics 365 and Azure IOT Central are having same account and two green tick marks are there as below.
Further, click on ‘Continue’
The flow configuration page is shown:
that application is chosen from the dropdown with applicate we created earlier.
Rule: It will be
Button B pressed as we created earlier
Organization name: your
current org (choose from the dropdown)
Entity name: IoT
Alerts (OOB Entity – no need to choose. It is chosen by default)
can leave it as it is you may customize as per your wish.
Once above details are entered, click on ‘Save’ (You may
also use ‘Flow Checker’ to validate your flow).
Click on ‘Done’ The configured rule on the device will now look like below:
Head over to the device, click on Button B.
Now, come to your CRM instance and open ‘Connected Field Service’ app
Go to My Work -> IoT Alerts
There you go! We can see the IoT alert being created! WOW!
At-last, we have our Scenario 2 covered as well.
Well, this is just a tip of the iceberg. The possibilities are endless. You may wish to bring in your own scenarios as per the capability of the device.