Associate records in plugin

When creating N:N relationships between entities, CRM allow us to associate records. This is a great functionality to track and reference records through entities. Although this can be done manually, find below a method to associate two records programmatically:  

Plugin to only allow users with certain role to deactivate records

As variant to a recent post I did, here's another plugin to manage the Activation/Deactivation of records. In this post, I'll describe a plugin that will control these actions in Contact Entity by only allowing users with an specific role. Plugin step details: Message: Update Filtering Attributes: statecode Run in user’s context: Calling User Event … Continue reading Plugin to only allow users with certain role to deactivate records