How to do it...

  1. Open a previously created plugin solution in Visual Studio.
  2. Add the following private variable:
private Guid serviceEndpointId; 
  1. Ensure that the public constructor of your class accepts a string parameter called config and add the following code to you constructor:
if (string.IsNullOrEmpty(config) || !Guid.TryParse(config, out serviceEndpointId)) 
{
throw new InvalidPluginExecutionException("Service endpoint ID should be passed as config.");
}
  1. In your Execute method add the following code:
var cloudService = (IServiceEndpointNotificationService)serviceProvider.GetService(typeof(IServiceEndpointNotificationService)); 
if (cloudService == null)
throw new InvalidPluginExecutionException("Failed to retrieve the service bus service.");
string response = cloudService.Execute(new EntityReference("serviceendpoint", serviceEndpointId), context);
  1. Compile your code and register the assembly in your Dynamics 365 instance.
  2. Using the Plug-in Registration Tool add a post-update step to your plugin with the following details:
    • Message: Update
    • Primary Entity: account
    • Filtering Attributes: Account Name
    • Execution Mode: Synchronous
    • Unsecure Configuration: <Your endpoint GUID>
    • Click on Update Step
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.166.7