Cust.-rule #2: Use entity-icons!

Did you ever see navigation entries like this in the following picture on the left side? Doesn’t it look like “unfinished”? The entry on the right picture looks more professional, right?

image

Because of that: Always use icons, if you are creating a new entity – always! Doing this is really easy. This is the way I do this:

1. What icons do I need?
An entity needs two icons:
- 16×16 pixels
- 32×32 pixels (This is the one you can see then in the navigation.)

2. Get a tool!
There are several ways to create icons. I use very often the “Metro Studio” from Syncfusion. You can download this free tool from here.

image

3. Create the icons

# Description
1 Start the “Metro Studio”
2 Search your favorite icon in the top right corner or choose from the categories on the left side hand.
3 Once you found your icon, just click on it.

I use the following options for the 32×32 icon:
- Width: 32px
- Padding: 4px
- Icon color: #FFFFFFFF

image

Important: Use white color, because Microsoft does it too. So your icon will look like more “integrated” in the whole CRM app.4Click “Export” to save your icon in the png-format.5Repeat the same to create the 16×16 picel icon.

4. Add the icon the the entity

# Description
1 In Dynamics CRM navigate to your entity, open its properties and click “Update Icons” in the ribbon of the entity window:
image
2 Add the icons to the entity by adding a webresource. This is one way to do this:
image
image
image
image
image

5. Save and publish your entity – That’s it!


Cust.-rule #1: New entity – Think about its properties first!

Always think about the two following things BEFORE you create a new entity!

1. Entity properties you can set ONLY BEFORE creating the entity
There are 2 options, which you can not change or activate after creating an entity. (Marked in purple color) The first one is the ownership, the second one is “Define as an activity entity” which means, the new entity should inherite from the actitiy entity and then can be used per example in the social pane area.

image

2. Entity options you can set but NOT remove after creating an entity
If you are creating a new entity from scratch, there are a few options (mostly marked with “†”) which you cannot undo after the entity is saved. (Marked in blue color) But you can still enable them once the entity is saved.

image

Remember: Less is more!
So, if you are not sure, weather you need one of this options (per example “Activities”) on your entity, just leave the checkbox blank! You still can enable this options after creating the entity!


Customizations rules – A new blog series

image_thumb13

This is the start of my new blog-series about CRM-customizations rules which are making your CRM-system more attractive and “cleaner”.

This series is perfect for CRM-newbies but also should give input to experienced CRM-system customizers.

Stay tuned, the first blog entry will be public very soon!


Error while activating BPF: “Invalid Business Process.”

Problem: Today I was not able to activate a business process flow. I got a business process error:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #6D99E8D8Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ActivityId>c0b9f582-977a-49f6-b5ed-2209f1586a05</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #6D99E8D8</Message>
  <Timestamp>2017-12-11T16:29:45.6122634Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>c0b9f582-977a-49f6-b5ed-2209f1586a05</ActivityId>
    <ErrorCode>-2147089527</ErrorCode>
    <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Invalid Business Process.</Message>
    <Timestamp>2017-12-11T16:29:45.6122634Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Solution: After some research I found the problem. There was a related Process which was in draft modus. After activating the process I was able to activate the BPF.

image


Import solution with PowerShell is not activating SDK-steps

Today I deployed a solution with SDK-steps with the following PowerShell (intro to CRM and PowerShell can be found here):

if (-Not (Get-Module -Name Microsoft.Xrm.Data.Powershell)) { 
     Import-Module Microsoft.Xrm.Data.Powershell 
}

$zipLocation = 'C:\Users\x.y\Downloads'
$timeoutInSeconds = 600

$crmOrg = Get-CrmConnection -InteractiveMode
Set-CrmConnectionTimeout -TimeoutInSeconds:$timeoutInSeconds -conn:$crmOrg

Import-CrmSolutionAsync -SolutionFilePath:$zipLocation'\SdkSteps_Managed.zip' -OverwriteUnManagedCustomizations:$true -conn:$crmOrg -MaxWaitTimeInSeconds:$timeoutInSeconds -BlockUntilImportComplete:$true

Problem: After deploying the solution most of the SDK-steps were disabled.

Solution: Adding the following Import-CrmSolutionAsync-parameter solved the issue: 

-ActivateWorkflows:$true

So this paramteres triggers not only the activation of workflows it activates also the SDK-steps.


Error deleting a custom entity – Generic SQL error

Problem: Last week I a had to clean up a crm-system. So I had to delete a lot of fields and also entities. Deleting a custom entity caused the famous error “Generic SQL error.” After enablig the trace on the crm-server I got some more details:

>Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "solutioncomponent_parent_solutioncomponent". The conflict occurred in database "ORG_MSCRM", table "dbo.SolutionComponentBase", column 'RootSolutionComponentId'.

Solution: After some googling and try outs, i realized that other solutions were still containing the entity. After removing the entity of all solutions (there were two more) I was able to delete the custom entity.


Are you missing your CRM-Outlook-AddIn?

In case you are missing the CRM-AddIn buttons in your outlook and you are sure you installed the AddIn, then maybe the following steps will help you:

1. Open the outlook-options: image

2. Navigate to Add-Ins and open the COM-Add-Ins list:

image
3. If the following checkbox is unchecked, check it and click OK: image
Et voila: Your buttons are back! image

PowerShell & Dynamics 365 (Part ll): Let’s connect!

This second part of the series shows step by step, how to setup a connection with Dynamics 365 and create a simple account.

1. Have a look at Part l to setup the basis.
2. Open the “Windows PowerShell ISE”:
image
3. Import the module
# import the module

Import-Module Microsoft.Xrm.Data.Powershell

4. Connect to the Org:

# connect to a dynamics 365 organisation 
Connect-CrmOnlineDiscovery –InteractiveMode

This will show a modal dialog where you can access the CRM (Online or OnPrem):

image

Click “Login” to get the available orgs and then click “Login” again to setup the connection to Dynamics 365.

After successful login the prompt shows you information about your organisation:

image

4. And now, let us create some data! The following command will create a simple account and return the GUID:
$accountId = New-CrmRecord -conn $CRMConn -EntityLogicalName account -Fields @{"name"="proCRM";"telephone1"="123-456"}

That’s it for today. The next post will show how to get data from CRM by PowerShell


PowerShell & Dynamics 365 (Part l): Setup the basis!

This is the first part of a blog post series about PowerShell together with Dynamics 365 (CRM).

Why PowerShell?

PowerShell-Commands are useful in many cases. Here a short overview what PowerShell can do:

  • Read/Write CRM-settings
  • CRUD CRM-records
  • Do complex data-modification without coding
  • Setup organization
  • and a lotmore!

Let’s start

1. Download the newest version of the “Microsoft.Xrm.Data.PowerShell”-Module: https://github.com/seanmcne/Microsoft.Xrm.Data.PowerShell/releases
2. Right click the downloaded zip file and click “Properties”.
3. Check “Unblock” checkbox and click “OK”, or simply click “Unblock” button depending on OS versions:
image
 

Extract the zip file and copy “Microsoft.Xrm.Data.PowerShell” folder to one of the following folders:
”%USERPROFILE%\Documents\WindowsPowerShell\Modules” or “%WINDIR%\System32\WindowsPowerShell\v1.0\Modules”

That’s it, we are ready. The next post of this series will show how to create a connection to a Dynamics 365 organization. Stay tuned!

(Source for this blog entry and more information: https://github.com/seanmcne/Microsoft.Xrm.Data.PowerShell)


Cannot remove the field “Name” from the lead form?

Problem: On the lead entity we only want to have the customer field (account or contact) and remove the field “Name” (fullname).  If we try to remove the field from the form, we are getting an error:

image

The field itself is marked as optional:

image

So why can we not remove the field from the form?

Solution: The fullname is a composite field of two fields: “firstname” and “lastname”. If one field of a composite field is marked as required the hole composite field will be required on the form. (it doesn’t matter if the field is required or not.)

In our case it was the field “lastname” which was marked as required. After changing that to “optional”, we could successfully remove the field from the form.