Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Workflow custom action for SharePoint Online

$
0
0

Hi,

Can any body please help. I want to use/execute below code in workflow custom action for sharepoint online site. I actually want to develop workflow custom action to further use it in SharePoint designer 2013 for a sharePoint Online site:

   using (SPSite site = new SPSite(context.CurrentWebUrl))
            {
              using (SPWeb web = site.OpenWeb())
              {
                string groupName="";
                  foreach(SPGroup spg in web.Groups)
                        {
                            spg.Name.Contains("Approvers");
                            groupName=spg.Name.ToString();
                            break;
                        }
                SPUser user = web.EnsureUser(web.CurrentUser.Name);
                    if (user.Groups.Cast<SPGroup>().Any(g => g.Name.Equals(groupName)))
                   {
                        results["IsApproverUser"] = true;
                    }
                    else
                    {
                       results["IsApproverUser"] = false;
                    }
              }
            }

Thanks

Atiq


Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>