3

I have created Custom Workflow Action based on this msdn article and SPUserCodeWorkflowContext return Hashtable results with specific values. Its worked and implement on my SharePoint Workflow 2010(PlatForm Type) Workflow into SPD.

  public Hashtable GetRelevantSubscribeUser(SPUserCodeWorkflowContext context)
    {
        //hashtable that will be returned can be used for return values.
        Hashtable retVal = new Hashtable();

        using (SPSite site = new SPSite(context.CurrentWebUrl))
        {
            using (SPWeb web = site.RootWeb)
            {
                try
                {
                    retVal["Result"] = "test@gmail.com;test2@gmail.com"
                }
                catch (Exception ex)
                {
                    retVal["Result"] = string.Empty;
                }
            }
        }
        return retVal;
    }

My Question :

I want to deployed this custom workflow action into SharePoint Workflow 2013(PlatForm Type). Can we used same kind of code into Workflow Action on SharePoint 2013?

1

1 Answer 1

3

If you want to use Workflow Foundation 4.5 (that is used in SharePoint 2013 and SharePoint Online) you can use different approach to create custom action (but, it will work only in Sharepoint 2013, in Sharepoint Online you can use only declarative activities)

The second way, you can deploy your action in SharePoint 2013 and use 3.5 Workflows Foundation for create your workflows. Or you can use interop for calling your workflow (v3.5).

2
  • Thanks roman,Your first way(Declarative activites) does not support code functionality on SharePoint online. Am i getting right? I would like to used Code on my custom action :( May 23, 2014 at 5:20
  • Yes you're right. There is no way to run your code in SharePoint Online. As workaround you can write your custom web service and call them from workflow or jQuery. And service will connect to your SharePoint Online and do something useful.
    – Roman
    May 23, 2014 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.