Advertisements

Archive

Archive for the ‘Dynamics Portals’ Category

‘Portal Comment’ not showing up – Dynamics Portals

‘Portal Comment’ is an OOB activity which comes with Portal solution and enables peer-to-peer interactions between Portal Users and Dynamics Users.

To add ‘Portal Comment’ for a record, go to ‘ACTIVITIES’ tab on the form and select ‘Portal Comment’.

PC_5

Problem Statement:

  • ‘Portal Comment’ added from Dynamics on a record not showing up in Portal.
  • Below is a ‘Portal Comment’ added for Case record ‘Test’.

PC_1

  • It was not showing up on Case record on Portal

PC_2

Reason and Fix:

  • ‘Portal Comment’ will only show up on Portal, when the ‘SEND’ button clicked (i.e, Status = Completed)

PC_3

  • Now, open the record in Portal and you should see the ‘Portal Comment’
    • Note: Text added in ‘Description’ field of ‘Portal Comment’ will show up on Portal

PC_4

  • ‘Portal Comment’ can also be added from Portal by using ‘Add Comment’ button and it will show up in ‘ACTIVITIES’ tab of the record.

🙂

Advertisements

Dynamics Portal Caching issue – Missing ‘Clear Cache’ button

As you are aware, to clear the cache in ‘Dynamics Portals’, you need to login with a Portal user with ‘Administrators’ web role and

  • Navigate to {Portal_url}/_services/about.
  • Click on ‘Clear Cache’ button

But what if you don’t see the ‘Clear Cache’ button, even if you logged in with ‘Administrators’ web role?

We encountered the same and were getting a blank screen when we browsed ‘_Services/about’ by logging in with ‘Administrators’ web role.

Portal-Cache ClearReason:

  • Even though you are having ‘Administrators’ web role, you may be missing ‘Website Access Permissions’

Fix:

Grant the missing ‘Website Access Permissions’ to ‘Administrators’ web role by following below steps.

  • Open your Dynamics application
  • Go to ‘Advanced Find -> Web Roles’

Portal-Cache Clear - 6

  • Open the ‘Administrators’ web role
    • Note : If more than 1 Portal solution (i.e., Custom Portal, Self service portal etc..) enabled, you will see more ‘Administrators’ records. Make sure you filter with ‘Website’.
  • From the navigation, open the ‘Website Access Permissions’

Portal-Cache Clear - 3

  • If no existing records in ‘Website Access Associated View’, create a new record (Note: If there is existing record, open the same)

Portal-Cache Clear - 4

  • In the new record window, select all the checkboxes under ‘Permissions’ section.

Portal-Cache Clear - 5

  • Save and Close.
  • Now from the Portal, browse {Portal_url}/_services/about
  • You should get the Portal Details screen with ‘Clear Cache’ button.

Portal-Cache Clear - 7

🙂

Dynamics Portals – Hide Search Control and clear cache

Other day, we got a requirement to hide the ‘Search’ control from our Custom portal.

Search-1

Its very easy to achieve by changing a configuration.

Steps to hide Search control:

  • Go to Portals ->Site Settings ->Search/Enabled record
  • By default the ‘Value’ will be ‘true’, to hide the ‘Search’ change to ‘false’

Search-5

  • Save
  • Refresh the browser and you should not see the ‘Search’ control

Search-2

What if you are still seeing the ‘Search’ control:

Sometimes for some reason (Mostly due to caching), you wont see the change immediately.

In this case you can either reset portal/clear the server side cache by following steps below.

Reset the Portal:

  • If the change is not taken place for all users you might want to reset the portal.
  • Resetting the portal is not feasible option especially when your portal is being tested, as the end users will experience a snag for sometime.
  • But if the Portal is in Development phase and you can reset from your ‘D365 Admin Center’
    • Go to ‘Admin Center’ -> Applications
    • Select your Portal application and click ‘Manage’

Search-4

  • Select ‘Portal Actions’ -> Reset

Search-3

Clear Server Side Cache:

  • You can force the portal to refresh its cache immediately.
  • To clear the server-side cache, sign in to the portal with Administrator web role
  • Navigate to the URL as follows : <Your_portal_URL>/_services/about
    • (i.e., You need to append /_services/about end of your portal URL)
  • Select Clear Cache.
  • Refer this for article more details

🙂

 

Dynamics Portal Issue – Unable to submit Entity Form

February 17, 2018 Leave a comment

Recently we encountered a strange issue in our Dynamics Portal SaaS variant.

We got a requirement to allow Portal users to create ‘Custom Activity’ records from Portal.

To achieve this, we created an Entity form for the Custom Activity with mode set to ‘Insert’ and configured Web Template.

Portal - Entity Form

Issue:

  • After configuring Entity Form, Page Template and Web Template, we could not save the record from Portal.
  • Up on ‘Submit’ button click on Create form, there was no server post back.
  • On browser console, “Unable to set property ‘isvalid’ of undefined or null reference” exception has been logged.

Portal - Web Template Error

Reason and Fix:

  • Issue was due to the additional character in ‘Web Template’ Source HTML content (refer below highlighted) and correcting the HTML fixed the issue.

Portal - Web Template

🙂

Dynamics Portals – Execute FetchXML and Parse the results – Liquid script

January 22, 2018 Leave a comment

In one of our Portal requirements, we had to build custom screen (i.e., Web Template) and retrieve the results from Dynamics 365 and bind to grid.

In this article, I am going to detail the steps to Execute FetchXML based on conditions and read the results.

As we know that Dynamics portals use Liquid to add dynamic content to pages, lets prepare the Liquid.

High level design:

  • Liquid executes only on the page load, hence create a new Web Template (will be called only in background) and add the Liquid in it.
    • Imp Points:
      • In the web Template where you copy your Liquid to, specify the ‘MIME Type’ as ‘application/json’WT_Resolved Cases
        • You need to uncheck, below property in the ‘Page Template’ associated with the Liquid ‘Web Template’.

WT_1

  • From my Search screen web template, on change of Dropdown, I will call the above Web Template by passing selected the view as Query string.
  • Up on calling the background template, it executes the Liquid and return the results in Json collection
  • Capture the collection and render the results in table.

Liquid to fetch Cases:

In below liquid, I am reading the query string parameter ‘V‘.

  • If ‘V’=0, Prepare ‘Open Case’ filter
  • If ‘V’=1, Prepare ‘Resolved Case’ filter
{% fetchxml cases %}
<fetch>
<entity name=”incident”>
<attribute name=”incidentid”/> <attribute name=”title”/> <attribute name=”createdon”/> <attribute name=”casetypecode”/> <attribute name=”ticketnumber”/> <attribute name=”subjectid”/> <attribute name=”caseorigincode”/> <attribute name=”customerid”/> <attribute name=”statuscode”/> <attribute name=”statecode”/> <order descending=”true” attribute=”createdon”/>
<filter type=”and”>
{% if request.params[‘V‘] == 0 %}
<condition attribute=”statecode” value=”0″ operator=”eq”/>
{% endif %}
{% if request.params[‘V’] == 1 %}
<condition attribute=”statecode” value=”1″ operator=”eq”/>
{% endif %}
</filter>
</entity>
</fetch>
{% endfetchxml %}
{ “totalcount”: {{ cases.results.total_record_count }},
“morerecords”: {{ cases.results.more_records }},
“page”: {{ request.params[‘page’] | default: 0 }},
“results”:
[
{% for item in cases.results.entities %} {
“incidentid”: “{{ item.incidentid }}”,
“title”: “{{ item.title }}”,
“statuscode”:”{{ item.statuscode.label }}”,
“createdon”:”{{ item.createdon }}”,
“subjectid”:”{{ item.subjectid.name }}”,
“customerid”:”{{ item.customerid.name }}”
}{% unless forloop.last %},{% endunless %} {% endfor %}
] }

Liquid’s Field Parsing Syntax:

If you notice, I have used {% for item in cases.results.entities %} to loop through the FetchXML results.

  • To read a Look up field text, {{ item.customerid.name }}
  • To read a Option set Label, {{ item.statuscode.label }}

🙂

Dynamics Portals – SaaS – Refer helper files in Web Templates

In my portal, I got a requirement to build a ‘Search Screen’, which pulls the data from CRM and render the results.

To achieve this, I configured a ‘Web Template’ with ‘Search Screen’ using HTML and decided to use Data Tables  table control to bind the results.

The challenge is, to use ‘Data Table’ control, I must refer the helper files (i.e., datatable.min.js, jquery.datatable.css) in my ‘Search Screen’ Web Template.

One way to solve is to copy the content from the helper files (i.e., datatable.min.js, jquery.datatable.css) and paste within the Web Template. This is a crude way as the single Web Template size enormously grows and would become unmanageable.

Optimal way:

  • Create a separate Web Templates for Helper files (i.e., datatable.min.js, jquery.datatable.css)
  • Make sure you wrap the script file’s content in <script> tag, while pasting to Web Template.

WT - JS

  • Make sure you wrap the style sheet (i.e., css) files content in <style> tag, while pasting to Web Template.

WT - CSS

  • Refer the helper file Web Templates in the ‘Search Screen’ Web Template.
    • Syntax is {% include ‘Your helper file Web Template Name‘ %} 

Refer files 3

Notes:

  • Using Web  Files is one approach but you cannot attach JScript file to your Web File as the .js file extension is restricted.

🙂