Skip to content

Tag: Workflow

Empty pipelinephase on opportunity quickcreate

Posted in Dynamics 365, Power Platform, and Revive

You all know the most common usage of the pipelinephase field of an opportunity. It’s the sales funnel chart in sales dashboards.
By default the pipelinephase field is filled with the number of the current business process, followed by its name. But sometimes it stays empty. You can imagine how unhappy the sales guys are about that.

What I found out

It depends on how you create the opportunity. If you create an opportunity through the quickcreate feature, where it does not matter if you use the global “+” sign or the contextual “+” sign of a subgrid to create it, the pipelinephase field will not be filled until you step further in the next phase.

Workaround

Build an asynchronous workflow on opportunities that is triggered on create and fills the pipelinephase field if it is empty.

Below you find a solution to download that contains this workflow. It takes dynamically the phase name of the current business process. It is also an ondemand workflow, so that you can run from a view or advanced find that shows you all open opportunities with an empty pipelinephase field.

Issue reporting

There is already an proposal on CRM-Ideas for this issue. You can find it H E R E. It is already 9 month old and has only 4 votes. My appeal to you, follow the link, sign in and vote for it. The more votes it get, the higher is the attention from Microsoft.

Workflow ExecutionTimeSpan

Posted in Dynamics 365, Power Platform, and Revive

Last week I had a problem as part of a service request at Microsoft. I should test how long it takes to create a record for a particular entity by a workflow. The whole thing had to be very precise, because the request has been caused by an excessive execution time of a plug-in chain when such a record has been created.

Experimental Setup

The workflow should create a new contact, based on the data of an existing contact record. Let’s name it a Light-copy without relations. It is so configured that an entry in the systemjobs will be created.

Workflow-Log

Unfortunately, the workflow log is not as meaningful as intended. It contains the only times to the minute.

But that brings me at least an idea. Dynamics CRM stores the data internally with a higher accuracy than it displays it on the surface. Now I just have to get that data, mind you in a CRM Online system.

Workflow ExecutionTimeSpan

Since it is well known fact that you can not access the database in CRM Online directly, I planned to create a query that returns “Created On” and “Modified on” of my workflow. I used the OData Query Designer from the Dynamics XRM Tools to create that query.
When selecting the fields for my query I found a field named “Zeitspanne für Ausführung” field, or in English “ExecutionTimeSpan”. BINGO! That sounds good!

The Query

YOURSERVERURL/xrmservices/2011/OrganizationData.svc/AsyncOperationSet?$select=Name,StartedOn,CreatedOn,CompletedOn,ModifiedOn,ExecutionTimeSpan&$filter=OperationType/Value eq 10&$orderby=CreatedOn desc

To make the URL more understandable for you:

  • The Organization Data Service (OData) URL of your CRM.
    YOURSERVERURL/xrmservices/2011/OrganizationData.svc
     
  • The table from which I need the data.
    AsyncOperationSet?
     
  • The columns from the table that I would like to see as result.
    $select=Name,CreatedOn,StartedOn,CompletedOn,ModifiedOn,ExecutionTimeSpan
     
  • There should be only system jobs of type “Workflow” being returned.
    $filter=OperationType/Value eq 10
     
  • Finally, I would like to have the results sorted by creation date, so that the most recent are on top.
    Who wants to look for a long time.
    $orderby=CreatedOn desc

The Result

<xml version="1.0" encoding="utf-8" standalone="yes">
    <feed xml:base="http://od4u-crm2013.cloudapp.net/FC/XRMServices/2011/OrganizationData.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
      <title type="text">AsyncOperationSet</title>
      <id>http://od4u-crm2013.cloudapp.net/FC/xrmservices/2011/OrganizationData.svc/AsyncOperationSet</id>
      <updated>2014-10-05T08:07:34Z</updated>
      <link rel="self" title="AsyncOperationSet" href="AsyncOperationSet" />
      <entry>
        <id>http://od4u-crm2013.cloudapp.net/FC/XRMServices/2011/OrganizationData.svc/AsyncOperationSet(guid'40107141-ab4b-e411-80df-00155d572098')</id>
        <title type="text">LightCopy</title>
        <updated>2014-10-05T08:07:34Z</updated>
        <author>
          <name />
        </author>
        <link rel="edit" title="AsyncOperation" href="AsyncOperationSet(guid'40107141-ab4b-e411-80df-00155d572098')" />
        <category term="Microsoft.Crm.Sdk.Data.Services.AsyncOperation" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <content type="application/xml">
          <m:properties>
            <d:Name>LightCopy</d:Name>
            <d:CreatedOn m:type="Edm.DateTime">2014-10-04T09:46:04Z</d:CreatedOn>
            <d:StartedOn m:type="Edm.DateTime">2014-10-04T09:46:17Z</d:StartedOn>
            <d:CompletedOn m:type="Edm.DateTime">2014-10-04T09:46:22Z</d:CompletedOn>
            <d:ModifiedOn m:type="Edm.DateTime">2014-10-04T09:46:22Z</d:ModifiedOn>
            <d:ExecutionTimeSpan m:type="Edm.Double">1.7</d:ExecutionTimeSpan> 
            <d:ModifiedOn m:type="Edm.DateTime">2014-10-04T09:46:22Z</d:ModifiedOn>
          </m:properties>
        </content>
      </entry>
    </feed>

In the marked area you can see the columns that we have retrieved and in line 23 the value of workflow ExecutionTimeSpan.
Thus, so the workflow had an execution time of 1.7 seconds.

With Power Query for Excel you can you view the data a little more beautiful, or a whole series of workflows to evaluate and calculate averages with Excel or be generated diagrams. Simply Excel.

Hope it helps!

Entfernen von E-Mail Anlagen aus Dynamics CRM

Posted in Dynamics 365, and Power Platform

Neulich kam von einem Kunden die Anforderung Speicherplatz in Dynamics CRM Online wieder freizugeben da die 5 Gigabyte beinahe erschöpft waren. Ich empfahl dem Kunden den Artikel “10 Methoden zum Freigeben von Speicherplatz in Microsoft Dynamics CRM Online” aus dem Microsoft Dynamics CRM Online-Resourcencenter.
Bei Methode 3 – “Entfernen von E-Mail Anlagen aus Dynamics CRM Online mithilfe der erweiterten Suche” kommt man nach dieser Anleitung jedoch nicht weiter und deshalb widme ich mir dieser Problematik an und stelle eine bessere Lösung vor.

Lösungsversuch nach Anleitung

  1. Klicken Sie auf Erweiterte Suche.
  2. Wählen Sie in der Liste Suchen nach die Option E-Mail-Nachrichten aus.
  3. Fügen Sie im Suchkriterien-Bereich Kriterien hinzu, die mit den folgenden vergleichbar sind:
    E-Mail-Anlagen (Element)
    Dateigröße (Bytes) – Ist größer als – Geben Sie im Textfeld einen Byte-Wert ein, beispielsweise “25000”.
  4. Klicken Sie auf Suchen.
  5. Sie verfügen jetzt über eine Liste von E-Mails mit Anlagen, die größer als “X” Bytes sind.
  6. Sie können jede E-Mail öffnen, auf die Registerkarte Anlagen klicken und jede gewünschte Anlage löschen.


Schritte 1 – 5 erledigt sieht so aus.

Öffnet man eine E-Mail aus der Suchergebnissen und wechselt in die “E-Mail Anlagen” Registerkarte stellt man fest dass man keine Option zum löschen der Anlage vorfindet. Das liegt daran dass die E-Mail bereits abgeschlossen ist, also gesendet oder empfangen ist.

Über einen Workflow könnte man den Status der gefundenen E-Mail Nachrichten ändern, dann einzeln pro E-Mail die Anlagen löschen und mit einem weiteren Workflow die E-Mails wieder als gesendet oder empfangen schließen. Mit dieser Methode könntet ihr einige Stunden nur für das Entfernen von E-Mail Anlagen aus Dynamics CRM verbringen.

Bessere Lösung zum entfernen von E-Mail Anlagen aus Dynamics CRM

Jason Lattimer hat dieses Problem erkannt und eine Option zum Löschen von E-Mail Anlagen in seine “Internal Email Helpers” Solution integriert. Diese steht kostenlos auf CodePlex zur Verfügung und einfach in Dynamics CRM Online importiert werden.

Nach der Import der Lösung erstellt man einen Workflow für die Entität “E-Mail”. Setzt die Ausführung auf “bedarfsabhängig” und entfernt das Häkchen für “Starten bei: Datensatz wird erstellt”, es sei denn ihr möchtet grundsätzlich für alle neuen E-Mails die Anlagen entfernen. Dazu würde ich aber die Systemeinstellungen empfehlen da so die Anwender direkt eine Information von Outlook bekommen dass Ihre Anlagen nicht mit der E-Mail zu CRM hochgeladen wurden.

Fügt dem Workflow folgenden Schritt hinzu:

Legt die Eigenschaften so fest und aktiviert anschließend den Workflow.

Mit diesem Workflow kann man massenhaft Anlagen löschen ohne vorher eine erweiterte Suche erstellen zu müssen, den Status der gefundenen E-Mails mehrfach ändern zu müssen und ohne jede E-Mail einzeln anfassen zu müssen. Zusätzlich wird in den Notizen der E-Mail ein Hinweis mit Namen der gelöschten Datei hinterlassen.
In der Praxis könntet ihr beispielsweise für die Anwender eine Ansicht mit Ihren E-Mails mit Anlagen über 2,5 MB erstellen, so dass jeder seine Anlagen checken kann bevor ihr mit Workflow die Anlagen entfernt.