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!


Supported .NET Framework Dynamics 365 (4.6.1 not supported!)

Problem: After migrating a Dynamics CRM environment from 2016 OnPrem to Dynamics 365 Online I was getting the following error message every time a plugin or a custom-workflow-activity was triggered:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 
Unexpected exception from plug-in (Execute): <Plugin.Message>: System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ActivityId>6e625317-1f6a-46ff-8883-afaa96cb51ef</ActivityId>
  <ErrorCode>-2147220956</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Unexpected exception from plug-in (Execute): <Plugin.Message>: System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.</Message>
  <Timestamp>2017-08-22T08:18:06.9730831Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault i:nil="true" />
  <OriginalException i:nil="true" />
  <TraceText>

Solution: After analyzing the problem and having a look at MSDN, I found out that the plugins CWAs were compiled with .NET-Framework 4.6.1 but only 4.5.2 is supported. After changing it back to 4.5.2, compiling and deploying everything worked well.