cub-e.net

just coding...

Directions EMEA 2018 - The Hague

Directions EMEA is an independent conference for Microsoft Dynamics partners from the ERP and CRM channels focusing on the SMB market. It is organized by partners for partners.

The Directions conference provides the Dynamics community with a forum for knowledge sharing, networking and discovering new opportunities for future growth and collaboration. It is a must-attend event where partners can enhance and build their networks to reach a broader SMB market, learn about the latest product developments and tools, as well as enrich their operational and technical knowledge.

Since 2008 Directions EMEA has grown year by year. 2018 will take place in The Hague on October 29 – 31, 2018.

I have a session in this event on 29th October Monday in S-America room.

See you there 🙂

Dynamics 365 Community Event in Dubai on 9th and 10th February 2018

Dynamics 365 Saturday is a free Technical & Strategy Event Organised by the Microsoft Dynamics Community MVP’s For CRM and ERP professionals, technical consultants & developers. Learn & share new skills whilst promoting best practices, helping organisations overcome the challenges of implementing a successful digital transformation strategy with Microsoft Dynamics 365.

Dynamics 365 Saturday will replace CRM Saturday to provide a single platform to serve the whole Dynamics 365 community, the core customer experience values and ethics of CRM Saturday will continue to live on through 365 Saturday with the rest of the Dynamics Community.

I have a session in this event on 10th February. Session name is “Dynamics 365 V9 New Features & Deprecations” in Microsoft Dubai Office in Media City between 13:00 and 14:00. Also I will share my knowledge on Dynamics 365 in Hackathon on 11th February.

My session focuses on who interested in taking the plunge to “code”. The session will be covering all development structure. Attendees can easily see the difference between versions from a development perspective and will be particularly helpful for those who work on upgrade projects.

For more information and program agenda please visit : http://mwns.co/dj18 

We would like to see you there.

CRM Solution Concepts


Solutions and layering are fundamental concepts within CRM that need to be fully appreciated and understood to construct an approach to lifecycle management for Dynamics CRM applications. There are three key concepts that need to be introduced:

§   Solution Packages: Act as containers for functionality required to be deployed as a unit

§   Layers: The consequence of a specific component being affected by change within one or more solutions

§   Managed Properties: The mechanism to control how layers interact with each other

Note: This appendix provides a “quick reference” overview of more detailed information that is presented in the Dynamics CRM 2011 SDK, in the section Package and Distribute Extensions.

Solution Packages

Solution packages are the container mechanism to transport Dynamics CRM configuration and customization between organizations. There are two types, unmanaged and managed.

Unmanaged

§   Contains only customizations from the unmanaged layer

§   Will not include dependent components

§   Imports only into the unmanaged layer:

       Ideal during development

       Everything within could be changed

       Overwrites existing customizations

§   Contains a complete copy of each component

Managed

§   Will get its own layer on import.

§   Analogous to an installer “.msi” file; it is a distribution package.

§   Contents cannot be directly changed.

o    This does not mean DRM.

§   Components may be customized where managed properties allow.

§   Contains only deltas for component that supports merging (FormXML, Ribbon & Sitemap).

Layers

Layers should be considered on a per-component basis. Although typically drawn to convey the effect of a solution on another solution, this is always at a component level.

Unmanaged

§   There is only one. It always exists.

§   All customizations made on this server/organization will reside here.

§   “Solutions” exist here as containers.

       Ownership by solutions is weak; by-reference only.

       No independence between solutions. If one component exists in two solutions, they both see the current state of the component equally.

§   New customizations made will trump all prior customizations. (They override the lower layers.)

§   Customizations cannot be undone, but they can be deleted.

 

Managed

§   There can be many:

o    Always one for the “system” solution.

o    Discrete layer for each managed solution package imported (at a per-component level).

§   Only created by importing a managed solution.

§   Time of import sets order of precedence.

§   You cannot customize components inside the layer.*

§   They can be deleted, replaced, and versioned.

§   Deleting a layer may delete data.

Managed Properties

Managed properties control how layers interact with each other; they control the level of customization achievable on top of components from a managed solution that has been imported. After releasing a managed solution, the managed properties can only be changed to reduce how restrictive they are.

§   Control order of precedence (which customizations to allow on top of an imported solution’s managed layer).

§   The ability to customize cannot be removed or disabled during solution update.

§   The ability to customize can be enabled during solution update.

§   The default ability to customize is fully customizable.

In general, if the consumers of the solution are not known or trusted or the changes that may be made could break the solution, it is recommended to lock down the managed properties for the solution. These managed properties can be opened back up to enable specific components to be customized at a later date as needed.

Merge Behavior

Unmanaged

New customizations trump all prior customizations, overriding the lower layers.

Important: Changes applied by importing an unmanaged solution cannot be uninstalled. Do not install an unmanaged solution if you want to roll back the changes.

Managed (No Overwrite)

§   Customizations in unmanaged layer are preserved.

§   Importing newer versions creates new managed layers directly above the previous version’s managed layer.

§   Importing the same version replaces contents within the existing layer.

§   Importing cannot remove pre-existing components.

§   Generate and import a minimal solution to “hotfix” a larger solution.

§   Reports, E-mail templates, and plug-in assemblies skip updates if they are not the “top” layer.

Managed (Overwrite)

The recommended approach is to always preserve customizations (no overwrite). If the updates are mandatory for the solution to function appropriately, then overwrite is needed:

§   Replaces the content of the “unmanaged” layer and makes the managed solution the top layer.

§   Ensures that updates included in the solution are effective.

§   Overwrites all customizations and should be used with caution.

§   Greater use of managed properties makes this approach less necessary.

Dependency Tracking

The solutions framework automatically tracks dependencies across components.

§   The following operations perform dependency checks/operations:

       Individual components: CRUD, Add Existing (to a solution).

       Solution: Import, Export, Delete (uninstall).

§   Dependencies are version agnostic. As long as the unique name/id of the component and the package type matches, a dependency is considered valid.

       Managed components cannot depend on unmanaged components.

Shared Publishers

§   Components in managed layers will be owned by the solution publisher.

§   Publisher owns the component, not the solution.

§   Components with same name and publisher will be considered the same thing.

§   Removing a solution does not remove a component when it is referenced by another solution using the same, shared publisher.

§   Be wary of predictable names and collisions.

       For web-resources, create names that imply virtual directories

 

Dynamics 365 UK Community Event in London on 26th-27th January 2018

Dynamics 365 Saturday is a free Technical & Strategy Event Organised by the Microsoft Dynamics Community MVP’s For CRM and ERP professionals, technical consultants & developers. Learn & share new skills whilst promoting best practices, helping organisations overcome the challenges of implementing a successful digital transformation strategy with Microsoft Dynamics 365.

Dynamics 365 Saturday will replace CRM Saturday to provide a single platform to serve the whole Dynamics 365 community, the core customer experience values and ethics of CRM Saturday will continue to live on through 365 Saturday with the rest of the Dynamics Community.

I and Ramon Tebar (Investec CRM Solution Architect) will share their knowledge on Dynamics 365 in Hackathon on 26th January also they have a session in this event on 27th January. Session name is “Dynamics 365 V9 New Features & Deprecations” in Theatre 1 between 10:00 and 11:00.

Their session focuses on who interested in taking the plunge to “code”. The session will be covering all development structure. Attendees can easily see the difference between versions from a development perspective and will be particularly helpful for those who work on upgrade projects.

DirectionsEMEA 2017 Madrid – Development on Dynamics 365 CRM

Directions EMEA is an independent conference for Microsoft Dynamics partners from the ERP and CRM channels focusing on the SMB market. It is organized by partners for partners. The conference is where Microsoft Dynamics Partners go to learn first-hand from Microsoft about the Microsoft Dynamics Roadmap and new features of the latest Dynamics NAV version (Tenerife). Following the concept of integrating CRM and ERP within Dynamics 365, Directions EMEA also offers a deep insight into Microsoft Dynamics 365 BE for Finance and Operations, Microsoft Dynamics 365 BE for Sales and Microsoft Dynamics 365 BE for Marketing, as well as ensures a comprehensive understanding of the Cloud Solution Provider program.

Directions EMEA brings together over 2000 developers, implementers, technical experts, sales, marketing and executive/owner representatives from Microsoft Dynamics Partners. For independent software vendors, the event is a unique opportunity to show their solutions to the largest Microsoft Dynamics Partner forum and demonstrate their readiness for Dynamics 365 BE as SaaS providers.

The Directions conference provides the Dynamics community with a forum for knowledge sharing, networking and discovering new opportunities for future growth and collaboration. It is a must-attend event where partners can enhance and build their networks to reach a broader SMB market, learn about the latest product developments and tools, as well as enrich their operational and technical knowledge.

Since 2008 Directions EMEA has grown year by year. In 2016, it attracted almost 1800 attendees from 580 companies as well as 60 sponsors. 2017 is the 10th annual conference and will take place in Madrid on October 4 – 6, 2017.

Our CEO Baris Kanlica has a session in this event on 6th October Friday in Venecia room. Session name is  “Dynamics 365 new development features and deprecations” and it is is focused on those new to CRM development or CRM administrators interested in taking the plunge to “code” customization. The session will be covering all development structure of the Dynamics platform since version 2011. Attendees can easily see the difference between versions from a development perspective and will be particularly helpful for those who work on upgrade projects.

See you there :)

https://mawens.co.uk/directionsemea-2017-madrid-development-on-dynamics-365-crm/

Improve Microsoft Dynamics 365/CRM service channel allocation performance

The OrganizationServiceProxy and DiscoveryServiceProxy service proxy classes provide the ability to establish a connection to and communicate with the available Microsoft Dynamics 365/CRM services. However, improper use of these API's can potentially reduce application performance. Therefore, if you understand when and how to effectively leverage these service client API's, available in the SDK, you can optimize communication traffic between your application the Dynamics 365/CRM server.

 

When you establish a Windows Communication Foundation (WCF) service channel by using one of the service endpoints, for example, the Organization.svc, your application must perform two additional, time-consuming operations: 1) metadata download from the endpoint and 2) user authentication. You can improve performance if your application performs these operations a minimum number of times for each application session. The OrganizationServiceProxy constructor shown below performs both of these operations, in addition to allocating a new service channel, every time a service proxy object is created.

 

Violation Example

new OrganizationServiceProxy(new Uri(this.orgServiceUrl), nullthis.Credentials, null)

A first step towards improving performance is to minimize the number of times your application uses this constructor to create an instance of the service proxy.  If possible, use this constructor only one time during the application session and cache the returned reference for use in different code paths within your application. Notice that the returned service reference is not thread safe so multi-threaded applications will need to allocate one instance per thread. Applications must also call Dispose on the service proxy object before they terminate in order to free service channel allocated resources.

 

The service proxy class performs the two previously mentioned operations, metadata download and user authentication, by using the following public methods available as client API's.

 

Guideline Example

IServiceManagement<IOrganizationService> sm = ServiceConfigurationFactory

        .CreateManagement<IOrganizationService>(new Uri(orgServiceUrl));

 

this.Credentials = sm.Authenticate(this.Credentials);

 

The CreateManagement method performs the metadata download while the Authenticate method authenticates the user. The returned objects from these methods are thread safe and can be statically cached by your application. 

 

As a more efficient alterntive, you can then use these objects to construct a service proxy object via one of the other constructor overloads (depending on the authentication scenario):

 

newOrganizationServiceProxy(sm, this.Credentials.ClientCredentials)

 

newOrganizationServiceProxy(sm, this.Credentials.SecurityTokenResponse)

These constructor overloads bypass the two aforementioned operations and use the referenced service management and authentication credentials passed as method arguments.  By caching the service management and authenticated credential objects, your application can more efficiently construct the service proxy objects and allocate multiple service channels as necessary over the lifetime of an application session without repeating the costly (and redundant) operations. 

 

If you enable early-bound types on OrganizationServiceProxy through one of the EnableProxyTypes methods, you must do the same on all service proxies that are created from the cached IServiceManagement object. If your application uses the metadata, we recommend that it caches the metadata that it retrieves and periodically calls the RetrieveTimestampRequest message to determine whether it must refresh the cache.

 

In addition, monitor your WCF security token (Token) and refresh it before it expires so that you do not lose the token and have to start over with authentication. To check the token, create a custom class that inherits from the OrganizationServiceProxy or DiscoveryServiceProxy class and that implements the business logic to check the token. Or wrap the proxy classes in a new class. Another technique is to explicitly check the token before each call to the web service. Example code that demonstrates these techniques can be found in the ManagedTokenDiscoveryServiceProxy, ManagedTokenOrganizationServiceProxy, and AutoRefreshSecurityToken classes in the Helper Code: ServerConnection Class topic.

 


Performance Best-Practices: 

http://msdn.microsoft.com/en-us/library/gg509027.aspx#Performance

ServiceConfigurationFactory.CreateManagement<TService>(Uri serviceUri)

http://msdn.microsoft.com/en-us/library/hh560440.aspx

IServiceManagement.Authenticate(AuthenticationCredentials authenticationCredentials)

http://msdn.microsoft.com/en-us/library/hh560432.aspx

Use Try and Finally on Disposable Resources

Why

Using a try/finally block ensures that resources are disposed even if an exception occurs. Not disposing resources properly leads to performance degradation over time. 

When

This is important guideline when working with disposable resources such as 

  • Database connections 
  • File handles 
  • Message queue handles 
  • Text reader, writer 
  • Binary reader, writer 
  • Crypto stream 
  • Symmetric, Asymmetric and Hash algorithms. 
  • Windows Identity, Windows Impersonation Context  
  • Timer, Wait Handle in case of threading 
  • Impersonation Context 
  • XML Reader 
  • XML Writer

How

The following code fragment demonstrates disposing resources in a finally block..

SqlConnection conn = new SqlConnection(...)

try

{

   conn.Open();

   ...

}

finally

{

   if(null != conn)

     conn.close();

}

If developing in C# you can use the 'using' keyword which will automatically dispose resources after their usage.

using(SqlConnection conn = new SqlConnection(...))

{

   conn.Open();   

   ....

}


Problem Example

A database connection is opened and used to access data. 

Unfortunately, if there is an exception other than SqlException or if the exception handling code itself throws an exception the database connection won't be closed. This failure to close database connections could cause the application to run out of database connection impacting application performance.

try

{

   conn.Open();

   // do something with the connection

   // some more processing

   // close the connection

   if(conn != null)

     conn.Close();

}

catch(SqlException ex)

{

   // do exception handling

   // close the connection

   if(conn != null)

     conn.Close();

}

Solution Example

A database connection is opened and used to access data. The finally block will be executed whether there is exception or not, ensuring that the database connection is closed. 

SqlConnection conn = new SqlConnection(...)

try

{

   conn.Open();

   // do something with the connection

   // some more processing

}

catch(SqlException ex)

{

   // do exception handling 

  

}

finally

{

   // close the connection

   if(conn != null)

     conn.Close();

}

 

 

Additional Resources

Related Items

Explicitly Call Dispose or Close on Resources You Open

If you use objects that implement the IDisposable interface, make sure you call the Dispose method of the object or the Close method if one is provided. Database connection and files are examples of shared resources that should be explicitly closed. 


Why

Failing to call Close or Dispose prolongs the life of the object in memory long after the client stops using it. This defers the cleanup and will result in inefficient memory usage. 

When

This guideline should be used when working with disposable resources such as:

  • Database connections 
  • File handles 
  • Message queue handles 
  • Text reader, writer 
  • Binary reader, writer 
  • Crypto stream 
  • Symmetric, Asymmetric and Hash algorithms. 
  • Windows Identity, Windows Impersonation Context  
  • Timer, Wait Handle in case of threading 
  • Impersonation Context 
  • XML Reader 
  • XML Writer 

How

When working with disposable resources call Dispose method of the object or Close method, if provided. The Close method internally calls the dispose method. The finally clause of the try/finally block is a good place to ensure that the Close or Dispose method of the object is called.

The following Visual Basic® .NET code fragment demonstrates disposing resources in finally block.

Try

  conn.Open()

…Finally

  If Not(conn Is Nothing) Then

    conn.Close()

  End If

End Try

In Visual C#®, you can wrap resources that should be disposed, by using a using block. When the using block completes, Dispose is called on the object listed in the brackets on the using statement. The following code fragment shows how you can wrap resources that should be disposed by using a using block.

using (SqlConnection conn = new SqlConnection(connString))

{

  conn.Open();

  . . .

} // Dispose is automatically called on the connection object conn here.


Problem Example

A .NET application opens a database connection. Unfortunately, the database connection is never disposed. Since it is not explicitly disposed the connection will stay active until the application terminates.  This unnecessarily increases the application's memory usage. Database connections are a limited resource, failure to dispose could result in the usage of all available database connections.

SqlConnection conn = new SqlConnection(...)

try

{

   conn.Open();

   // do some processing with the connection

}

catch(SqlException ex)

{

   // do exception handling

}


Solution Example

A .NET application opens a database connection. Calling Close method on the connection object in the finally clause ensures that the database connection is disposed after it has been used.  

SqlConnection conn = new SqlConnection(...)

try

{

   conn.Open();

   // do some processing with the connection   

}

catch(SqlException ex)\

{

   // do exception handling    

}

finally

{

   // close the connection

   if(conn!=null)

     conn.Close();

}

 


Additional Resources

Related Items

Use Try and Finally on Disposable Resources

CRM Saturday Oslo 2017

Please join us on the next CRM Saturday event in Oslo (Norway) on 26th August. My session is "D365 New Features & Deprecations"

Full details and registration can be found on the CRM Saturday website: http://mwns.co/cso2017

CRM Saturday is a Free CRM Technical & Strategy Event Organised by the Microsoft Dynamics Community MVP's For Dynamics 365 Professionals, Technical Consultants & Developers. Learn & share new Skills whilst Promoting the CRM Manifesto, helping organisations overcome the challenges of implementing a Successful CRM Strategy with Microsoft Dynamics.

This is a whole day event with a lot of speakers from all around the world. It is an advertising and recruitment free event, and we are setting up both a technical and a business/strategy track so there will be interesting session for everyone.