MS CRM Workflow: input/output arguments

Some time we need to send out or take inputs for custom workflows dynamically. To do so MS CRM provided input/output arguments, syntax of it is

Input arguments

[Input(“data type input”)]
public InArgument AtrName{ get; set; }

Output arguments
[Output(“data type output”)]
public OutArgument AtrName{ get; set; }

Input and Output argument

[Input(“data type input”)]
[Output(“data type output”)]
public InOutArgument AtrName{ get; set; }

and here is the example

public sealed class ArgumnetExample : CodeActivity
[Output(“Decimal output”)]
public InOutArgument FlowCount { get; set; }
protected override void Execute(CodeActivityContext executionContext)
//Create the IWorkflowContext and the
IWorkflowContext workflowContext = executionContext.GetExtension();

//IOrganizationService for communication with CRM
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension();
IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId);
decimal count = 0;
Do your bussiness
{   }

//it will set out put argumnet
FlowCount.Set(executionContext, count);

//and to collect input argument

dataTypeInput = Atrname.get(executionContext)

//do your



Then register above workflow in MS CRM and get the data in out of box workflow as shown below

WF in-out put That it To explore more use this link

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s