Sticky

This blog has moved to www.dreamingincrm.com. Please update your feed Url. Thank you.

Showing posts with label bugs. Show all posts
Showing posts with label bugs. Show all posts

21 February 2015

Bug: Limitation of Action EntityReference Input Argument

Actions are great for lot of things, but there are few bugs/limitations that I experienced and found particularly frustrating. One of such bugs is that you cannot use the attributes of an entityreference input argument on an action step. This is not the same with custom workflow step with an entityreference output. You would be able to use any attribute from the entityreference output off the custom workflow step.

Here is the action definition

The entityreference action argument is available in the dropdown and all the properties appear as if they can be used.




Here is the create email step with values from workflow and action argument being used.



I also have a custom workflow step that accepts an entityreference input and just sets the entityreference output.

The custom workflow step input is set the action input argument.


This code for the custom workflow step is quite simple.

using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Workflow;

namespace TestWorkflows
{
    public sealed class ActionParameterToContactEntityReference : CodeActivity
    {
        [Input("Contact")]
        [ReferenceTarget("contact")]
        [RequiredArgument]
        public InArgument<EntityReference> ContactInput { get; set; }

        [Output("Contact")]
        [ReferenceTarget("contact")]
        public OutArgument<EntityReference> ContactOutput { get; set; }

        protected override void Execute(CodeActivityContext executionContext)
        {
            ContactOutput.Set(executionContext, ContactInput.Get(executionContext));
        }
    }
}


This is the email activity after the action is created.



As you can see, the Email and Firstname properties from the action's input entity reference comeup as blank, but there is no such issue with the ones retrieved from the custom workflow step.

13 November 2014

Bug in Plugin Registration Tool for CRM2013 - 6.1

Today I wasted around half-an-hour trying to troubleshoot why Plugin Registration tool was not recognising my custom workflow activity. When I tried to register the assembly, the tool would not display any custom activity.


The version I was using is 6.1.1143.
I checked the obvious things
  1. Activity class is public
  2. Assembly is signed
  3. Workflow class extends CodeActivity
  4. Built using .net 4.5
Since I could not figure out the reason behind this issue, I tried this in the CRM2015 SDK Plugin Registration tool (v 6.1.0.519).



 
I was able to register the workflow assembly without any issues.  The old plugin registration tool worked without any issues as well. So, currently it seems, it is better to avoid the new plugin registration tool in CRM2013 SDK.