using System;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Query;
using System.Text.RegularExpressions;
namespace ActivityLibrary1
{
public sealed class KleinerTest : CodeActivity
{
protected override void Execute(CodeActivityContext executionContext)
{
ITracingService tracingService = executionContext.GetExtension<ITracingService>();
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
tracingService.Trace("test");
Guid ID = context.PrimaryEntityId;
Entity Entity = service.Retrieve("account", ID, new ColumnSet(true));
string input = "Testobjekt";
Entity["new_historie"] = input;
service.Update(Entity);
}
}
}
_____________________________________________________________________________
Error:
Unexpected exception from plug-in (Execute): ActivityLibrary1.KleinerTest: System.AggregateException: One or more errors occurred.
Unhandled Exception: Microsoft.Crm.CrmException: Unexpected exception from plug-in (Execute): ActivityLibrary1.KleinerTest: System.AggregateException: One or more errors occurred.
at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext)
*This post is locked for comments