I have created a custom activity with drop down properties using Enum values as suggested. And could see the activity with drop down property with values. But how do i get the selected drop down value into my code.
public enum Days
{
Day1,
Day2
}
[Category(“ListCredential”)]
[RequiredArgument]
public Days Day{ get; set; }
I’m implementing the AsyncCodeActivity class because I make a HTTP request in my custom activity. To fully implement the AsyncCodeActivity class I have to override the BeginExecute and EndExecute functions.
If you’re just doing a regular activity without an asynchronous call then you are implementing CodeActivity, which has no override functions called BeginExecute and EndExecute. You’re getting the error because you’re trying to override a function that doesn’t exist.
Sorry, that code I was using above was pulled from an older sample that wasn’t working, that’s my mistake.
SPEnvironment isn’t an InArgument or OutArgument so you don’t actually need the context to get or set it. Instead, you should be able to do “SPEnvironment.ToString()” and that will return either “Online” or “OnPrem”.
Here’s some of the most recent activity code:
public enum fileType
{
CSV,
TAB,
XML,
Excel
}
...
[Category("Input")]
[RequiredArgument]
[Description("Output file type for report results.")]
public fileType ReportFileType { get; set; }
...
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
{
...
//Add it to a dictionary
dict.Add("ReportFileType", ReportFileType.ToString());
...
}