Archive
Liquid script to fetch Contact names – Dynamics Portals SaaS
In Dynamics portals (SaaS) to make CRM server calls to retrieve the data we must rely on Liquid Script.
In this article, I am going to retrieve Contacts and loop through to capture Contact ‘Full Name‘ using Liquid Script and display on a Web Template.
Liquid script to fetch Contacts:
{% fetchxml settings %}
<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false”>
<entity name=”contact”>
<attribute name=”fullname” />
<attribute name=”telephone1″ />
<order attribute=”fullname” descending=”false” />
</entity>
</fetch>
{% endfetchxml %}
{% assign result = settings.results.entities %}
{% for item in result %}
{% assign Names = {{item.fullname}} | append: ‘ , ‘ | append: {{Names}} %}
{% endfor %}// Set the Concatenated text to Span so that it can be read in JScript
<span id=”spanContactNames” style=”display:block”>{{Names}}</span>
Complete Web Template Source:
<html lang=”en” xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta charset=”utf-8″ />function onload() {
// Read Contact names from Span
var spanContactNames = document.getElementById(“spanContactNames”);
if (spanContactNames) {
alert(spanContactNames.innerText);
}
}</head>
<body onload=”onload()”>
<h1>**Contact Names**</h1>
{% fetchxml settings %}
<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false”>
<entity name=”contact”>
<attribute name=”fullname” />
<attribute name=”telephone1″ />
<order attribute=”fullname” descending=”false” />
</entity>
</fetch>
{% endfetchxml %}
{% assign result = settings.results.entities %}
{% for item in result %}
{% assign Names = {{item.fullname}} | append: ‘ , ‘ | append: {{Names}} %}
{% endfor %}
<span id=”spanContactNames” style=”display:block”>{{Names}}</span>
</body>
</html>
Note :
- ‘Liquid Script’ gets executed during the Web Page render and hence the fetched values will be available on Page ‘onload’ script event.
- ‘Liquid Script’ will respect the Portal security model (i.e., It fetches the records only if you have access granted by your Web Role)
How to test:
- Create a new Web Template and paste the content to “Source” field.
- Add a Web Link and map your Web Template.
🙂
Dynamics 365 Portals – How to configure the logo of your Portal
Once you enable “Portal Add On” in your Dynamics instance, your OOB portal would look as below with “Contoso, Ltd.” text at top left corner.
Note: I enabled ‘Customer Service’ portal solution. If you install different solution, UI will be different.
Steps to configure your desired logo on the Portal:
Add PNG/JPG file as ‘Web File’
- Log in to your Dynamics 365 instance
- Navigate to Portals -> Web Files and click ‘New’
- Provide below details on your new ‘Web File’
- Name: Can be anything. This will be referred in ‘Content Snippet’ in following steps
- Parent Page: Home
- Partial Url: Can be anything.
- Save the record
- Go to ‘Notes’ tab and add your png/jpg file as attachment.
Update content snippet with web file reference
- Navigate to Portals -> Content Snippets
- Open “Navbar Left” snippet
- In Value(HTML) field value’s ‘Source’ tag, replace content with below
<p style=”margin-left: -1px;”><img style=”top:-25px; width: 100px; height: 53px; margin-right: 1px; margin-left: 1px; float: left; position: relative;” src=”/{Webfile Name}” /></p>
- Save the file
Open/refresh the Portal and you should see your logo. You might want to logout and login if you don’t see the logo.
🙂
Dynamics Portals – How to get the configured Portal’s URL
There was a question posted in my blog on how to get the configured Portal’s URL as someone else configured the portal.
Below are the steps to get your Portal URL.
From your Dynamics 365 Instance:
- Connect to your Dynamics 365 instance
- Navigate to Portals -> Website Bindings
- Open the record and read the URL from “Site Name” field
From your Dynamics 365 Admin Center:
- Connect to your “Dynamics 365 Admin Center” (i.e., Login to Portal.office.com)
- Select your “Dynamics 365” instance
- Click on “Applications” tab
- Select “Portal Add-on” and click “MANAGE” button
- You would be redirected to “Portal” configuration page
- Copy the URL
Note: You can access your Portal configurations page, only if your Admin granted access to your login Account. If you don’t have permission, you would end up getting below error message:
You don’t have permission to perform this action. Contact your global administrator to get owner permission for Application ID
🙂
Configure CafeX Live Assist on Dynamics Portals
In this article, I am going to detail the steps to configure ‘Live Assist’ on ‘Dynamics Portals’.
Those who are not familiar with CafeX Live Assist, Live Assist for Microsoft Dynamics 365 Powered by CaféX is a fully integrated omnichannel (i.e., across mobile and web) solution. It provides Chat, Co-browse features.
Note: As we are going to configure ‘Live Assist’ on Dynamics Portals, make sure you have enabled Dynamics 365 portal solution on your Dynamics 365 instance.
To start with, enable the ‘Live Assist’ solution on your Dynamics 365 online instance.
Enable ‘Live Assist’ solution in Dynamics 365 instance:
You can start your ‘Live Assist’ free trail from ‘App Source’
- Go to ‘App Source’ Live Assist for Dynamics 365 Powered by CaféX page
- Complete the suggested steps which installs the ‘Live Assist’ solution in your Dynamics 365 Instance.
- Once you followed the steps, give it few minutes and you should see ‘Live Assist for Dynamics 365’ solution with ‘Installed’ status.
- Open your Dynamics 365 instance and you should see the ‘CafeX’ tool bar.
Enable ‘Live Assist’ on Dynamics Portal:
In ‘Live Assist’ scenario, your Dynamics Portal acts as Visitor site and Dynamics 365 works as receiver (i.e., Agent) site, which means, Portal users initiate the chat which will be addressed by CRM User.
Below are the 2 steps to configure Chat window on your Dynamics Portals which allows your Portals User to initiate the chat.
- Copy the chat widget script from CafeX site:
- Check your email inbox for Cafex confirmation mail with CafeX website URL.
- Navigate to the URL and click on ‘GET STARTED’ tab
- Click ‘COPY’ button to copy the chat widget script.
2. Configure Portal Web Template:
- Go to Dynamics 365 and open the ‘Header’ web template.
- Paste the widget script you copied in earlier steps.
- Save the Web Template.
We are done with configurations and it’s time to test the Chat.
‘Live Assist’ Usage steps:
- Open the Dynamics Portal URL and you should see a “Live Chat” button floating.
- Click the button and start the Chat.
- Message from Portal will be instantly delivered to CRM Agent.
- Note: CRM Agent ‘Live Assist’ Status must be ‘Available‘
🙂
(401) Unauthorized Error – CRM integration with SharePoint
We encountered below exception when we were integrating CRM with SharePoint.
Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
Environment details:
- CRM 2016 on-premise with Claims authentication enabled.
- SharePoint Server On-premise with Claims authentication enabled.
- User Account using to set up is Admin on both the CRM and Sharepoint servers.
Reason & Fix:
Fix suggested in this MSDN Forum worked for us.
It seems there is a known issue/bug with CRM 2016 that doesn’t allow this to work if you try using https in the MetadataEndPoint.
To get this working, you will have to temporarily do the following items before running the SharePoint Power Shell command.
Note : Make sure you note all the existing settings before executing below steps which helps you to roll back, if something goes wrong.
Steps:
- Open the CRM Deployment Manager tool
- Disable CRM IFD
- Disable CRM Claims Configuration
- Open the IIS and remove the https binding on the CRM Web site and add back the http binding for the CRM Web site.
- Run CRM Deployment Manager and change the properties of the deployment for the Web Address to use http instead of https.
- Run an IISReset on the CRM Server to ensure this is now accessible via http.
- Run the SharePoint PowerShell commands (you should be able to access the MetadataEndpoint using http vs. https now if you put it in the browser (and it should prompt to download a .json file).
- Once the SharePoint commands are finished running, you need to reverse the changes above in CRM to re-enable IFD.
- Change the CRM Web Address to use https in the CRM Deployment Properties.
- Remove the http binding on the CRM Web site and add back the https binding, selecting the correct SSL Certificate.
- Run the Configure CRM Claims in the CRM Deployment Manager. (keep the existing settings)
- Run the Configure IFD in the CRM Deployment Manager (keep existing settings).
- Run an IISReset on the CRM Server.
Refer MSDN article which details integrating SharePoint on-premise with CRM on-premise.
🙂
Organization Insights – Dynamics 365
What if your customer ask you to provide a report on the No of Active Users,Licenses, Most used entities etc. The answer is “Organization Insights” solution.
Organization Insights for Dynamics 365 (online) provides usage metrics for your Dynamics 365 organization, and tools to help you track and monitor the performance and support issues.
Steps to download and install:
- Open the browser and login to your Dynamics 365 instance
- Download the “Organization Insights” solution by click here
- Click “Agree” and you will be redirected to Dynamics 365 Admin Center “Manage Solutions” page.
- Give it sometime to get the solution installed
- After the solution installation navigate to your application (Settings -> Organization Insights)
Organization insights provide below information once you installed:
- Active Usage Dashboard
- Provide the details of
- No of Dynamics 365 users
- No of licenses are in use
- List of custom entities that are used most frequently
- Data in Dashboard updates every hour
- Provide the details of
- System Jobs Dashboard
- Will help us to monitor and troubleshoot workflows
- Data in Dashboard updates every hour
- Plug-ins Dashboard
- Will help us to monitor and troubleshoot plug-ins
- Data in Dashboard updates every hour
- Storage Dashboard
- Provides a look at storage used by your tenant and instances
- Data in Dashboard updates every day
- API Call Statics Dashboard
- Will help us to to monitor and troubleshoot API calls.
- Useful if you have any 3rd party system pull or push the data in to CRM.
- Data in Dashboard updates every hour
- Mailbox Usage Dashboard
- Will help us to monitor email mailbox usage like No of mail boxes, Active email server profiles etc.
- Download Dashboard
- Allow us to download the data selected for the date range in an Excel spreadsheet.
- It provide details like: Most Used OOB and Custom Entities, Most Active Users Performing Operations (i.e., Retrieve/Retrieve Multiple/CRUD operations)
OData Support:
- Organization Insights supports retrieving chart data through the Web API.
Refer below article for more info:
🙂
Manage your Instance Storage – Dynamics 365
In this article I am detailing on
- How to check the amount of storage organization is using
- How to increase/purchase Additional storage
- ways to reduce the amount of storage space
Storage limit depends on the type of subscription you purchase initially. For 30 days trail you would get 5 GB of storage. If you are run out of storage, you can add more.
Monitor the storage:
To monitor the storage consumption
- Login to your O365 Account’s Admin Center
- We can check the amount of storage under Service Health tab
Alternatively you can install “Organization Insights” solution to your Dynamics 365 and monitor the storage in detail.
Refer my article to know more about Organization Insights
Increase/Purchase Additional storage:
To add additional storage
- Login to your O365 Account’s Admin Center
- Billing -> Purchase services
- Under “Add-on subscriptions” choose “Dynamics 365 – Additional Database Storage”
- Note: This is not available if you are on 30 days trail subscription.
Reduce the amount of storage space:
We can reduce the data storage by deleting certain categories of data as the need arises, or you can set up bulk deletion jobs to reoccur at set intervals.
A particularly important note is delete the data only if you are sure that it is no longer needed as you cannot get back the deleted data.
Below are the ways to reduce/free the data storage:
- Delete bulk email and workflow instances using a bulk deletion job
- Delete suspended workflows
- Delete Email attachments if they are no longer required
- Delete Notes with attachments if they are no longer required
- Delete bulk duplicate detection jobs and associated copies of duplicate records
- Every time that a duplicate detection job runs, a copy of each duplicate record is stored in the database.
- Delete by navigating to Settings -> Data Management -> Duplicate detection jobs
- Delete bulk import instances
- Every time you perform a bulk import, there is a system job associated with that import.
- Delete bulk Delete instances
- Delete Audit Logs
- Be cautious before deleting, as can no longer view the audit history for the period covered by that audit log.
- Delete by navigating to Settings -> Auditing -> Audit Log Management -> Delete Logs
Refer below articles for more info.
🙂