Tip #383: Enable Preview Features and Use CRM in Outlook on a Mac

If you have CRM Online 2015 Update 1, there are several preview features that you can enable. For instructions on how to enable these features, see this link.

Probably the most exciting preview feature is the new CRM App for Outlook. This is the Outlook client reimagined as an Office app. One of the more exciting ramifications of this is that it will now work on a Mac. I would like to apologize to all of the people that I told that the Outlook client would never work on a Mac without virtualizing Windows. It truly is a new day.

Important things you should know:

  • This is a preview feature–that means that it should be treated like a beta. You should test it, and you don’t have to push it out to all of your users.
  • It’s not out yet (but will be very shortly).
  • It requires Outlook 2013, CRM Online, and server sync. Yet another reason to go to server sync.

 

 

Tip #382: Training? On New Features? Free? Yes, Please!

All A lot of good things in this life are free. Including, as it turns out, some awesome CRM training videos.

There is, I kid you not, the whole TRAINING TAB in the Dynamics CRM section on YouTube, and after a release becomes publicly available, Dynamics CRM Support Team publishes awesome training videos about the new features for all the world to share. The latest and greatest Spring 2015 content has been updated here, covering different features, changes from previous releases, and best practices.

Go to https://www.youtube.com/user/msdyncomm/DynamicsCRM, click on Training tab on the right and be trained!

Tip #381: These tools give the shell its power

Since CRM 2013, SDK team has been including XRM tooling components in a low key fashion. It was kind of there but kind of was not getting any attention. Over the time though these tools have been slowly growing a reputation as one of the central building blocks in the SDK. Not surprisingly though, when you consider the functionality and flexibility these tools possess. For example, it is notoriously difficult to get the thread safety right in the CRM client applications; at the same time XRM tools claim to provide:

… thread safety for actions performed in CRM in a multithreaded environment.

The flexibility of the toolset is noticeable when applied to PowerShell. Consider this script (to be run in \bin folder):

.\RegisterXRMTooling.ps1
Add-PSSnapin Microsoft.Xrm.Tooling.Connector
$conn = Get-CrmConnection –InteractiveMode

Connect to your favourite CRM and now we can check, uhmmm, dunno, the plural name for an entity?

$conn.GetEntityDisplayNamePlural("contact")

Or verify if sample data installed?

$conn.IsSampleDataInstalled()

(Just in case you were expecting true/false – return values are Completed/NotImported – go figure)

Easy to connect, easy to create/read/update/delete the data, easy to execute. Some messages are confusing (CloseIncident() vs. CloseTroubleTicket() o__O) but overall impression of the toolset is very good and we’ll be covering more of it in the future.

Note

If you receive the following error executing Get-CrmConnection –InteractiveMode:

Get-CrmConnection : Set property 'System.Windows.ResourceDictionary.Source' threw an exception.
At line:1 char:1
+ Get-CrmConnection -InteractiveMode
...

then simply download and install the latest CRM SDK – the issue has been fixed.

Tip #380: Sort the chart by aggregate

Dynamics CRM TipperAnother mini truck stop. It seems that Adam “I bought the truckstop” Vero has become a regular despite his tendency of giving the answer first, asking the question later.

Our own Joel “Pretend I know nothing” Lindström asks:

Scenario: You have a chart of number of opportunities by opp type. How do you sort/order by the totals?

All I see in xml/SDK/crmchartguy is sorting by field values, nothing about sorting by the aggregate.

Boom! That’s the sound of the supersonic barrier broken by the Adam’s answer:

To do this using the UI (or at least using that as a means of getting started), add a “Top X” rule. If you choose a value for “X” larger than the expected number of categories, then this will simply sort by the aggregate values without filtering any out.

To sort by number of opportunities in each category in a ranked chart style like this, the XML will look something like this (the “count=”20” is what you would see if you use a Top X chart as the basis for this, remove if unwanted):

<datadescription>
  <datadefinition>
    <fetchcollection>
      <fetch mapping="logical" aggregate="true" 
             count="20">
        <entity name="opportunity">
          <attribute groupby="true" alias="OppType" 
              name="xxx_OpportunityType" />
          <attribute alias="OppCount" 
              name="opportunityid" aggregate="count" />
          <order alias="OppCount" descending="true" />

Hope this helps

t.j. – You bet it does!

Tip #378: Using Calculated Fields To Work Around Field Restrictions

Free book idea for aspiring CRM authors out there: “1001 uses for calculated fields.” (We’ve already written a few, you can take this one).

I’m continually amazed by the novel uses for calculated fields that go beyond the obvious uses. Latest example–working around crazy field limitations.

Consider the following example: We have an opportunity configuration where the estimated revenue is the total of the opportunity product plus the value of a couple of fields from the opportunity record. We have a plugin that handles the calculation, so we do not want the estimated revenue field to be “system calculated.” All good, except there is no way to make the estimated revenue field in CRM read only when the opportunity is set to “user provided.” Even if you set the field properties to “read only,” or you create a business rule to lock the field, the system form scripts will set the estimated revenue field to editable when the opportunity revenue is set to user provided.

Enter calculated fields.

I created a calculated field and called it Estimated Revenue Display. I set the calculation action to the value of the estimated revenue field.

Then, I put the calculated field on the opportunity form right next to the Estimated Revenue field. I edited the form field properties and changed the label to “Estimated Revenue.”

Then I set the properties of the Estimated Revenue field to not be visible.

The result is a read-only user provided Estimated Revenue field.

Tip #377: Case for a rollup field

¡Hola, amigos! Like if we did not have enough of Spanish at the eXtremeCRM Madrid 2015, we have Pablo “CRMGamified” Peralta in da houz with another spicy tip!

How to setup the new rollup fields to count the number of cases associated with a contract line

Hello,

In this article I will explain step by step a concrete example of usage of the new rollup fields in CRM 2015, which is to count the number of cases associated with a contract line.

Brief introduction

In Dynamics CRM, we have different types of contract templates depending on their allotment type:
Contracts and allotments

  • Number of cases: entitles the customer to care for x number of cases
  • Time: the customer is entitled to x hours of attention (eg up to 10 hours of support.)
  • Coverage dates: the customer is entitled to unlimited attention given date range.

This is how a contract made with the “Number of cases” template looks like with its lines, including its respective allotments used (in the example, the customer has received attention to 145 cases under that contract line)

The problem with Coverage dates contracts and why the new rollup fields are so useful is…

.. that Allotments Used field remains in 0 (zero), it isn’t updated when allotment type = converage dates.

Therefore, it is an excellent setting where to apply the new rollups fields :), to roll up the total number of cases handled under that contract line.

Let see how to do this.
Continue reading

Tip #376: Stay with the versions

Andre “I’ve got 88 in my handle” Margono reports from the development trenches:

Based on the recommended practice to get the latest assemblies of Dynamics CRM SDK through Nuget I encountered one problem when I recently working on a demo with a CRM online instance.

Tipp Jarr: the problem Andre has encountered is that when you have a good old project and pull the latest CRM assemblies via Nuget
Latest CRM Assemblies on Nuget
then chances are you will receive the following (misleading) errors when building the project:

The type or namespace name ‘Xrm’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)

What it means is that your project is compiled using Target framework 4.5.1 or earlier while latest CRM SDK wants at least 4.5.2.

As Andre continues:

As I’m still using Visual Studio 2012 (due to limitation of Developer Toolkit that currently supports up to VS 2012), I haven’t installed .Net framework 4.5.2 that required by the latest SDK v.7.0.0.1. Once I applied the .Net 4.5.2 update (developer pack version – t.j.), I get back with the development activities.

Tipp Jarr’s double-dip

And this is the perfect opportunity to observe chocolatey in action while you’re having a cup of beverage of your choice. Repeat after me: clist netfx-4.5.2-devpack.

Tip #375: Rolling in cash

Dynamics CRM TipperMini truck stop.

Finally, something exciting to discuss – money!

Today’s Roles

The Self-Healer: Jerry “I’m still in Kansas” Weinstock
For The Affirmative: Mitch “Snapshot” Milam

The problem, by Jerry

I have two rollup fields on a form – one for decimal and the other for currency – both pulling from the same child entity.

The currency rollup won’t display a value.

If I make a change to a field and save or just view the record and then go back to the grid view, no error message. However, if I refresh either calculated field I get this error when I navigate from the form:

<Message>’timeToString’ is undefined</Message>

It is on 7.0.1.121

Self-healing Solution, by Jerry

We finally figured out the issue. The distractor for us was that the error message <Message>’timeToString’ is undefined</Message> didn’t help us.

Side note – blah-blah, winge-winge (sensored – by t.j.)

How did this happen?

  • Import data into child records with currency data fields.
  • Create Currency Rollup field on Parent Record
  • Error gets thrown because child records don’t know what currency they are and the rollup process doesn’t like that. Child records are still happy.

Fix – set transactioncurrencyid for the imported records.

Is this a bug or is it behaving as expected?

Affirmation, by Mitch

That is to be expected.

Any time you have a currency field you must also have a currency added to the record. Without that, it does not know how to display the currency.

Normally, through the UI, this field is automatically populated but if creating records programmatically, you must always ensure that the transactioncurrencyid is populated. Import would be just another programmatic access method.

Good blog post there… (so here it is – t.j.)

Tip #374: NOT IN for the rest of us

Those with black belt in XML are familiar with the technique of building a FetchXML expression for NOT IN clause (e.g. accounts with no activities) and then sneaking that XML into a view definition to create non-editable view that returns the desired results.

What about the rest of us who don’t have the skillz or guts to edit customization.xml file?

  • Add a rollup field that counts the child records
  • Build a view that returns records where this field is zero

It’s not a real-time condition but is simple to build and use. In addition, the counter can be used as a quick visual indicator on the form itself if, for example, child records are not in the readily available subgrid.

Note: This tip was actually produced by Joel but since he’s too buzy or lazy to put this in writing, I’m taking all the credit.