Announcements
I did a build for a custom wf assembly in VS 2017.
The following is my code. There is no red squigglies and registered without error:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Query;
namespace CustomerAsset
{
public partial class CustomerAsset : CodeActivity
{
//public InArgument<EntityReference> CustomerAsset { get; set; }
protected override void Execute(CodeActivityContext executionContext)
{
//Create the tracing service
ITracingService tracer= executionContext.GetExtension<ITracingService>();
tracer.Trace("Begin Plugin Execution");
//Create the context
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
try
{
//DO WORK HERE
Entity entity = (Entity)context.InputParameters["Target"];
var targetCustAssOpHrsId = entity.Id;
tracer.Trace(entity.LogicalName);
tracer.Trace(targetCustAssOpHrsId.ToString());
QueryExpression qe = new QueryExpression();
}
catch(Exception ex)
{
throw new InvalidPluginExecutionException("error in CustomerAsset custom workflow assembly");
//throw new InvalidPluginExecutionException(ex);
}
}
}
}
The following is what I already attempted:
Is there any other gotchas? Im using dev guide rather than previous SDK so this is a bit new to me.
As you can see from code. I am just tracing. I threw a trace write after instanciating tracer and doesn't even get to that.
Also note, Im running this on-demand to test execution.
Sorry for the typo of 8.5.2. I meant 4.5.2 as I'm not living in the future lol. This was answered in Stack Overflow. I didn't have plugin trace log turned on in System Settings.
Hello,
1. Based on the code it's not a plugin. It's custom workflow assembly.
2. Compile your code using Framework 4.5.2.
3. Check following post - develop1.net/.../Method-not-found-!!0-SystemArrayEmpty()
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,807 Super User 2024 Season 2
Martin Dráb 229,135 Most Valuable Professional
nmaenpaa 101,156