Customizing Dynamics Portal Profile Page

PART 1: DEMYSTIFYING DYNAMICS 365 PORTAL PROJECTS - PART 1 PLANNING & ANALYSIS
PART 3: DEMYSTIFYING DYNAMICS 365 PORTAL PROJECTS - PART 3 ENTITY FORMS, ENTITY LISTS
In the part 1 of the series, I shed light on some of planning and analysis activities involved in a Portal project. From this part, I will be writing about some common portal project requirements and the way I have addressed those requirements.
Site Settings
One of the most basic portal configurations happen in Site Settings. Site Settings contain some global configuration used by portal framework. The complete list of portal site settings can be found here. However, there are some settings are deprecated since this link is taken from ADXStudio product and there are some settings that you will not find in the given link and I am listing down those settings in the below table:
| Setting | Description |
| Search/Enabled | A true or false value. If set to false will disable the search functionality from the portal so you will not see the magnifier sign on the primary navigation |
| DateTime/DateFormat | The format you want to show dates in your portal. For example, for British datetime format, I use d/M/yyyy |
| Profile/forcesignup | A true or false value. If set to true will force user to update their profile after signup. It means portal will redirect the user to the Profile page after successful signup |
|
Authentication/Registration/Ter |
A true or false value. If set to true, the portal will display the terms and conditions of the site. Users must agree to the terms and conditions before they are considered authenticated and can use the site |
| Authentication/Registration/Profile RedirectEnabled |
A true or false value. If set to false and profile page is disabled on the Portal, then Redeem Invitation workflow doesn't work properly and keeps redirecting user to same page in place of home page.
|
|
Authentication/Registration/Login |
If a portal only requires a single external identity provider, this allows the Sign-In link on the primary navigation to link directly to the sign-in page of that external identity provider |
| Authentication/Registration/Op enRegistrationEnabled |
A true or false value. If set to true allows any anonymous visitor to the portal to create a new user account. |
| Profile/ShowMarketingOp tionsPanel |
A true or false value. If set to false, it hides the marketing preferences area in the contact profile |
Dynamics Portal Profile page
Customising Profile Page
Scenario
- The mobile phone on the profile should be in the format xxxx-xxx-xxx
- The profile page should be editable if the contact has NO active cases
- The profile page should be read-only if the contact has active cases
Implementation
- Deactivate the existing Profile web page
- Create a new Entity Form called "Editable Profile Entity Form" interfacing "Profile Web Form" in Edit mode
- Create a new Entity Form called "Read-only Profile Entity Form" interfacing "Profile Web Form" in Read-only mode
- Create a new Web Template called "Profile Web Template" - We will talk about this template in details later
- Create a new Page Template named "Profile"
- Open the Profile Page template and set the following values
- Type=Web Template
- Entity Name= Web Page (adx_webpage)
- Web Template = Profile Web Template (created in the step 4)
- Create a new Web Page named "Profile".
- The profile page's partial URL must be "Profile"
- Set the parent page to "Home".
- Set the Page Template to the Profile Template (created on the step 6)
- Open the Profile Web Template and add the following liquid template:
{% block breadcrumbs %}
{% include 'Breadcrumbs' %}
{% endblock %}
{% block title %}
{% include 'Page Header' %}
{% endblock %}
{% block aside %}
{%include "side_navigation_portal" %}
{% endblock %}
<div class="col-sm-8 col-lg-8 left-column">
{% block main %}
{% endblock %}
</div>
{% fetchxml my_query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical"returntotalrecordcount="true" distinct="false">
<entity name="incident">
<attribute name="name" />
<attribute name="status" />
<attribute name="createdon" />
<filter type="and">
<condition attribute="parent_contact" operator="eq" value="{{User.Id}}" />
<condition attribute="status" operator="eq" value=0 />
</filter>
</entity>
</fetch>
{% endfetchxml %}
- The FetchXML block must be enclosed in the {%fetchxml my_query%} where my_query is holding the result of the query
- If you want to check the total records returned by the query, you must use returntotalrecordcount=true otherwise you will always get -1 in count of your records
- The total count of result of the query will be accessed by my_query.results.total_record_count
{% if my_query.results.total_record_count > 0 %}
{% entityform name: 'Read only - Profile Entity Form' %}
{% else %}
{% entityform name: 'Editable - Profile Entity Form' %}
{% endif %}
- Open Editable - Profile Entity Form
- From related records, go to "Entity Form Metadata"
- Add a new metadata record with the following properties:
- Type: Attribute
- Attribute Logical Name: Mobile Phone (mobilephone)
- Find Validation section down the form and add Validation Error Message
- Use the ^\d{4}\s\d{3}\s\d{3}$ as regular expression to ensure the mobile phone is in the xxxx-xxx-xxx format
- You can tick the "Is Field Required" to make the field required on the screen

Like
Report
*This post is locked for comments