Hi as i new to Crm i dont have clear idea of custom Workflow. so can anyone help me out. i need to get the outputparameter Account name through plugins. and then need to put in workflow as(Action )then the Account name should call shall any one help me out here is my plugin code.
namespace Workflowcustom1
{
public class Class1 : CodeActivity
{
[RequiredArgument]
[Input("Decimal input")]
public InArgument<string> AccountName { get; set; }
[Output("Retrieve")]
public OutArgument<string> s1 { get; set; }
protected override void Execute(CodeActivityContext context)
{
var workflowContext = context.GetExtension<IWorkflowContext>();
var serviceFactory = context.GetExtension<IOrganizationServiceFactory>();
var service = serviceFactory.CreateOrganizationService(workflowContext.UserId);
var account = this.AccountId.Get(context);
QueryExpression Retrieve = new QueryExpression("AccountName");
QueryExpression query = new QueryExpression("accounts");
query.ColumnSet = new ColumnSet(true);
EntityCollection retrieved = service.RetrieveMultiple(query);
string s1 = retrieved.Entities[0].GetAttributeValue<int>("AccountID").ToString();
}
}
}
i need to retrieve the accountname through plugins. can any one help