| Ijlal Monawwar
Before writing a plugin, we need to have an understanding of some terminology before proceeding. Here are some key terms often encountered when developing a plugin:
Execute method: It runs as the entry point for any plugin in Microsoft Dynamics CRM.
IserviceProvider interface: Provides access to various services of dynamics, it has one method called GetService() which allows us to get any type of service we want. Like Pluginexecutioncontext or Organization service.
Plugin Context: Has the contextual information passed to a plug-in at run-time. Contains information that describes the run-time environment that the plug-in is executing in, information related to the execution pipeline, and entity business information like table names and field values.
Organization Service: It is one of the API services of dynamics. It’s a class that provides access to the data for an organization. It’s necessary to include the package that contain this class to provide an interface with the CRM applications. Contains methods/functions like create, update, delete, associate to perform actions in our code.
Pluginexecution context has a property called InputParameters from which we can get Entity or Entityreferences from the incoming plugin event.
Target is one of the keys of Inputparameters. All plugin events are first stored in this variable. So, we need to check if this variable is there in the context. So, in our case we need to check if its entity because we need to trigger the plugin when account is created.
OutputParameters contain the response of the plugin after it’s executed. So, it is mainly used to get something after the event has occurred for example the id of the account record that has been created.
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.