Supposed I register a Plugin Step to "Merge" of "account". Pic below.
How do I know what the Plugin context/target will provide me? Is there any documentation about what the Plugin context will provide for the different Messages you can register to?
A plugin message always has a corresponding OrganizationRequest
and OrganizationResponse
.
In this case lookup the MergeRequest
class. It has 4 custom properties:
Target
- an EntityReference
pointing to the record that is supposed to be the remaining one.SubordinateId
- a Guid
referencing the record that is merged into the target.UpdateContent
- an Entity
containing the choices the user made regarding the merged fields.PerformParentingChecks
- a bool
allowing you to pre-emptively agree to any parenting changes during the merge.When you prefer to code early bound, you can use the IPluginExecutionContext
to get the original MergeRequest
like this:
public void Execute(IServiceProvider serviceProvider)
{
var executionContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
var request = new MergeRequest { Parameters = executionContext.InputParameters };
// Implementation continues here
}