web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to set two option field from code activity

(1) ShareShare
ReportReport
Posted on by 1,562

Hello Team,

I want to set two option control from the code activity by the workflow.

Please send me the correct way.I need to change it by the C# code.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Royal King Profile Picture
    27,686 on at

    You have to set value as Boolean value  like true or false

    Sample code to set two option set value

    entity.Attributes["attributename"] = true;

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    Assuming you want setup output argument to set two optionset, you need to define boolean property.

    other wise you can simply set entityobject["fieldname"]=true;

    For output:

    [Output("Response")]

    public OutArgument<bool> ResponseParameter { get; set; }

    then you can set this parameter using following code

    ResponseParameter.Set(executionContext, true);

    Now this argument will be available under form assistant while destining workflow

    you can refer our post:mahenderpal.wordpress.com/.../step-by-step-creating-custom-workflow-in-microsoft-crm-2011 for how to work with custom workflow

    Thanks

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Rahul,

    It might help you

    community.dynamics.com/.../136016

    if you need Boolean (both input and output)

    *For Input & output

    [Input("bool input")]

    [Output("bool output")]

    public OutArgument<bool> outBool{ get; set; }

    Output only:

    [Output("bool output")]

    public OutArgument<bool> outBool{ get; set; }

    To set:

    this.outBool.Set(context, true); //if true

    this.outBool.Set(context, false); //if false

    Hope this helps.

    Thanks.

  • Tin Profile Picture
    1,562 on at

    Thanks for reply.
    I want set value of two option set control from C# code via a cutome code activity.

  • Suggested answer
    Jharana Baliyar Singh Profile Picture
    2,667 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans