Tip #743: Portal Configuration Overview

Portals ExtraterrestrialIs this video we look at some of the basic configuration elements in Dynamics CRM Portal Capabilities. In addition, we also explore how to surface CRM info in the portal using Entity forms and Lists.

YouTube player

Give us your feedback, all of it: good, bad, and ugly, I’m sure we can take it. Suggest new topics either in comments or by sending your ideas to jar@crmtipoftheday.com.

Don’t forget to subscribe to http://youtube.com/crmtipoftheday.

Tip #742: List component has 2 months to live

FlatlineRecently, SharePoint has announced the removal of code-based sandbox solutions in SharePoint Online. As a result, the CRM SharePoint list control will stop working on November 30, 2016.

Here are details from SharePoint’s blog post:

  • As part of the removal process, activation of new code-based sandbox solutions, as well as updates of existing solutions are no longer available.
  • In the coming weeks, running code-based sandbox solutions in SharePoint Online multi-tenant environments also will be disabled. Customers with these solutions should watch the Message Center and Service Health Dashboard (SHD) for details, timelines, and exception processes.

CRM Online customers using SharePoint Online should move to server-side SharePoint integration immediately.

See also: Tip #611: On Server-Side SharePoint and Subfolders

Tip #740: How to flush cache in portal

Repair computerIf you are still trying to refresh your portal metadata using cache invalidation handle https://nottherealportal.microsoftcrmportals.com/Cache.axd?Message=InvalidateAll, stop it. The caching invalidation mechanism significantly changed and the legacy methods are no longer appropriate or supported.

Instead, remember the advice you gave your auntie when her computer was slow? That’s right, turn it off and then back on.

Navigate to CRM Admin Portal > Applications > Portal Add-On > Manage then turn your portal off, Update, turn it on, Update.

Turn portals off and on

That will restart the application and refresh metadata (note: the first page load after that could be excruciatingly slow so, if it’s a production system, choose your time wisely).

Tip #738: Use top in fetchxml

Tip top enrichedI’ll be first to admit: I was not aware that fetchxml supports top attribute (as it turns out, I’m not the only one hence the tip). It does not seem to be documented anywhere but, according to the schema, has been around since CRM 2011.

Consider this fetchxml

<fetch top="5" >
  <entity name="contact" >
    <attribute name="contactid" />
    <attribute name="fullname" />
  </entity>
</fetch>

It will emit the following SQL:

select top 5 
  "contact0".ContactId as "contactid",
  "contact0".FullName as "fullname" 
from
  ContactBase as "contact0"

And the output will be very concise, without any paging cookies and with morerecords=”0″ indicator.

Modify fetchxml to use count

<fetch count="5">

And sql becomes

select top 6 
  "contact0".ContactId as "contactid",
  "contact0".FullName as "fullname" 
from
  ContactBase as "contact0"
order by
 "contact0".ContactId asc

See? Count implies pagination and, to provide one, output needs to be sorted and one extra record is required (to be a marker for the next page). (Generally speaking, restricting results without a sort order is not very useful anywhere except testing but it’s a discussion for another day).

The difference is subtle but important: top means “give me X records and that’s it”, while page/count combination tells CRM “give me page Y of the data where page size is X records [and tell me how to get to the next page]”.

I would recommend using top if all you care about is a fixed top number of records (e.g. five most profitable accounts) and page/count when you do need to paginate over the resultset.

Tip #737: Introduction to the portals

Portal gunThis years Spring Update saw the inclusion of Portal Capabilities for Dynamics CRM online. If the first video in our Portal series, we walk you through some of the configuration options, as well and introduce some of the basic functionality and editing options available.

Our longest video yet.

YouTube player

Give us your feedback, all of it: good, bad, and ugly, I’m sure we can take it. Suggest new topics either in comments or by sending your ideas to jar@crmtipoftheday.com.

Don’t forget to subscribe to http://youtube.com/crmtipoftheday.

Tip #736: Add variables to your workflows

Canal plus flowchart horror movieWorkflows rule. They can wait until there is $10,000,000 in your bank account or forever (whichever happens first), they can update records, send emails and synchronously move mountains (subject to the 2 minutes timeout, and only if the mountain is referenced by a DNS-resolvable name). They can be quite complicated and often won’t fit on a single screen.

Sometimes they depend on a specific entity record, e.g. queue, user, team, currency, etc. Consider this sample workflow, assigning account to a team if it’s not already assigned:

Workflow with parameters

The main issue with this workflow is that the team is specified in multiple places:

  • If action is more complicated than assignment, e.g. custom activity, record update, email, you won’t even see that the team is used – you’ll have to navigate to the second screen.
  • If you deploy the workflow to another organization, workflow will be broken and explicit references to the team would have to be replaced before you can activate the workflow.

If only we could define variables, right? Custom actions, yet again, to the rescue.

Let’s create a global custom action, and add input and output parameters of EntityReference type (team entity):

Custom action with parameters

and create only one step that simply copies input into output:

Copy input into output

We can now rewrite our workflow to use this action to create a variable holding our team:

Final complex workflow with variables

Final workflow has all dependencies isolated in the custom action step, we know there are no dependencies elsewhere and, when we deploy this workflow into another organization, there is only one place where we need to set our parameters. This custom action can be extended to cover all variables you need, except notorious Picklist, Entity and EntityCollection data types – using any of these will make your action invisible in the workflow.

If you want to make a movie instead, check out CANAL+ flowcharts.

Tip #735: You can now use timezone in your appointments

Strangest timezonesSometimes it’s ridiculously trivial bugs that get in the way of implementing great functionality. Luckily, sometimes they get fixed. Gustaf “Surströmming” Westerlund reports from the field.

In earlier versions of CRM (I have tested it in CRM 2013 SP1) if you added a whole number field on appointment and formatted it as a timezone, you could no longer create any appointments without getting a crash.

I just tested CRM 2016 Update 1 and this works great now, so if you want to build logic that mimics the timezone behavior of Outlook (with syncing timezone of course, since that isn’t done), that can now be done. Also easier with the new timezone independent datetime fields.

Tip #734: You already have the icons

Under our nosesEssential part of every good CRM deployment is a nice and concise navigation. That includes customized sitemap and command bars. When new element is added to either of those, user experienced can be greatly enhanced with a good icon.

We already referred to the good external sources of the icons but one of the best sources has always been there, right under our noses. If you downloaded and extracted Dynamics CRM SDK, you’ll find hundreds of icons and images in the folder [CRM SDK]\Resources\Images. Most of these icons and images are already in use in Dynamics CRM but when the concepts are similar, e.g. Clone vs Copy, there is no reason not to grab one of the existing icons.