Exemple #1
0
        protected override void Execute(CodeActivityContext context)
        {
            var wfContext      = context.GetExtension <IWorkflowContext>();
            var servicefactory = context.GetExtension <IOrganizationServiceFactory>();
            var service        = servicefactory.CreateOrganizationService(null);
            var agreementRef   = AgreementReference.Get(context);

            try
            {
                AgreementService agreementService = new AgreementService(service);
                agreementService.DeleteAutocreatedRelatedInvoices(agreementRef);
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException(ex.Message);
            }
        }