Retention execution details are stored in RetentionOperation and RetentionOperationDetail tables. Retention policy details are stored in the RetentionConfig table. Query retention policy and execution details If (string.Equals(currentContext.MessageName, "PurgeRetainedContent"))ĬurrentContext = currentContext.ParentContext Var currentContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)) Private bool IsDeleteDueToRetention(IServiceProvider serviceProvider) Write your code to handle normal delete without retention Write your code to handle delete during retention If (IsDeleteDueToRetention(serviceProvider)) Public void Execute(IServiceProvider serviceProvider) The example plug-in code shown below applies to the delete operation due to retention. Var response = organizationService.RetrieveMultiple(queryExpression) ("versionnumber", ConditionOperator.LessEqual, maxVersionToPurge) ("msft_datastate", ConditionOperator.Equal, 1) Var retentionConfigId = orgService.Create(retentionConfig) Ĭonsole.WriteLine($"Retention policy created with Id : ) RetentionConfig = "FREQ=YEARLY INTERVAL=1" RetentionConfig = DateTime.Parse("T00:00:00") RetentionConfig = new OptionSetValue(10) RetentionConfig = "ui_RetainAllClosedOpportunities" RetentionConfig = "Retain all closed opportunities" Public void CreateRetentionConfig(IOrganizationService orgService)Įntity retentionConfig = new Entity("retentionconfig")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |