Process Classes, Attributes, and Microsoft Dynamics CRM Types(Microsoft CRM 2011 SDK)

Process Classes

The process classes are available in the Microsoft.Xrm.Sdk.Workflow namespace (Microsoft.Xrm.Sdk.Workflow.dll). You can use these classes to create custom activities in Windows Workflow Foundation, and then use the activities in the Processes area of Microsoft Dynamics CRM, or in the XAML workflows. For detailed information about the process classes, see Microsoft.Xrm.Sdk.Workflow.

Attributes and Microsoft Dynamics CRM Types

The Microsoft Dynamics CRM types are found in the Microsoft.Xrm.Sdk namespace (Microsoft.Xrm.Sdk.dll). Use the InputAttribute and OutputAttribute classes to annotate input and output properties.

The following types are supported for custom workflow activities:

Apart from the Input, Output, and Default attributes, some of the supported Microsoft Dynamics CRM types in the custom workflow activities require you to specify additional attributes such as ReferenceTarget and AttributeTarget. These are described below.

InputAttribute and OutputAttribute

The following sample shows how to add the input and output attributes to a Money parameter used in a custom workflow activity. It also shows how to specify a default value for the property.

[Input("Money input")]

[Output("Money output")]

[Default("232.3")]

public InOutArgument<Money> MoneyParameter { get; set; }

DefaultAttribute

You can use the DefaultAttribute class to specify a default value for an input parameter. The following examples show how to set the default value for each type using the Default attribute.

Bool

[Input("Bool input")]

[Output("Bool output")]

[Default("True")]

public InOutArgument<bool> Bool { get; set; }

DateTime

[Input("DateTime input")]

[Output("DateTime output")]

[Default("2004-07-09T02:54:00Z")]

public InOutArgument<DateTime> DateTime { get; set; }

Decimal

[Input("Decimal input")]

[Output("Decimal output")]

[Default("23.45")]

public InOutArgument<decimal> Decimal { get; set; }

Double

[Input("Double input")]

[Output("Double output")]

[Default("252.2")]

public InOutArgument<double> Double { get; set; }

EntityReference

[Input("EntityReference input")]

[Output("EntityReference output")]

[ReferenceTarget("account")]

[Default("3B036E3E-94F9-DE11-B508-00155DBA2902", "account")]

public InOutArgument<EntityReference> EntityReference { get; set; }

Int

[Input("Int input")]

[Output("Int output")]

[Default("2322")]

public InOutArgument<int> Int { get; set; }

Money

[Input("Money input")]

[Output("Money output")]

[Default("232.3")]

public InOutArgument<Money> Money { get; set; }

OptionSetValue

[Input("OptionSetValue input")]

[Output("OptionSetValue output")]

[AttributeTarget("account", "industrycode")]

[Default("3")]

public InOutArgument<OptionSetValue> OptionSetValue { get; set; }

 

String

[Input("String input")]

[Output("String output")]

[Default("string default")]

public InOutArgument<string> String { get; set; }

 

ReferenceTargetAttribute

The EntityReference attribute type requires you to specify the entity type being referenced using the ReferenceTargetAttribute class. The following sample shows how to add the input and output attributes to an AccountReference parameter in a custom workflow activity by using the ReferenceTarget attribute.

[Input("EntityReference input")]

[Output("EntityReference output")]

[ReferenceTarget("account")]

[Default("3B036E3E-94F9-DE11-B508-00155DBA2902", "account")]

public InOutArgument<EntityReference> AccountReference { get; set; }

AttributeTargetAttribute

The OptionSetValue attribute type requires you to specify the entity and the attribute being referenced using the AttributeTargetAttribute class. The following sample shows how to add the input and output attributes to an OptionSetValue parameter in a custom workflow activity by using the AttributeTarget attribute.

[Input("OptionSetValue input")]

[Output("OptionSetValue output")]

[AttributeTarget("account", "industrycode")]

[Default("3")]

public InOutArgument<OptionSetValue> OptionSetValue { get; set; }

RequiredArgumentAttribute

You can use the System.Activities.RequiredArgumentAttribute class to specify that an input parameter is required.

[RequiredArgument]

[Input("Update Next Birthdate for")]

[ReferenceTarget("contact")]

public InArgument<EntityReference> Contact { get; set; }

 

This entry was posted in MS Dynamic CRM 2011. Bookmark the permalink.

9 Responses to Process Classes, Attributes, and Microsoft Dynamics CRM Types(Microsoft CRM 2011 SDK)

  1. We fully appreciate your site post. You will find a lot of methods we could put it to good use while using minimum effort in time and hard earned money. Thank you so much with regard to helping make the post reply many issues we have come across before now.

  2. It was a real excitement locating your site a short while ago. I got here this day hoping to come across new things. And I was not disappointed. Your ideas about new techniques on this topic were enlightening and a fantastic help to us. Thank you for leaving out time to create these things plus for sharing your thoughts.

  3. I couldn’t currently have asked for a much better blog. You happen to be ever present to supply excellent advice, going instantly to the point for convenient understanding of your target audience. You’re truly a terrific professional in this subject matter. Thank you for being there for folks like me.

  4. It was something of great pleasure discovering your site recently. I came up here just now hoping to get something new. I was not dissatisfied. Your ideas upon new methods on this area were topical and a wonderful help to me personally. Thank you for leaving out time to create these things as well as sharing your thinking.

  5. young trader says:

    The tips you shared here are rather priceless. It was such a fun surprise to see that looking forward to me when I woke up today. They are generally to the point and simple to learn. Thank you for the valuable ideas you’ve got shared above.

  6. goal in life says:

    What would we all do without the marvellous suggestions you reveal on this blog? Who has the perseverance to deal with critical topics in the interests of common readers like me? My spouse and i and my guys are very fortunate to have your website among the ones we regularly visit. Hopefully you know how very much we love your work! Best wishes through us all.

  7. It is rare to find a professional in whom you may have some trust. In the world in the present day, nobody genuinely cares about showing others the answer in this subjecttopic. How fortunate I am to have definitely found a really wonderful website as this. It truly is people like you exactly who make a real difference nowadays through the strategies they discuss.

  8. I just wanted to let you know how much my partner and i appreciate everything you’ve discussed to help improve the lives of people in this subject material. Through your own articles, I have gone through just a newcomer to a pro in the area. It truly is truly a tribute to your efforts. Thanks

  9. I can’t thank you adequately for the content on your site. I know you’d put a lot of time and energy into these and hope you know how much I appreciate it. I hope I am able to do precisely the same for another person at some time.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>