0

ワークフローを実行するときにフォルダーを作成します。変数リポジトリーに静的リンク「https:/ /site/teamSite/" は機能しますが、この場合は失敗します。

private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
    {
        int item = onWorkflowActivated1.WorkflowProperties.ItemId;          

        SPFieldUrlValue fieldValue = new SPFieldUrlValue(SPContext.Current.Item["Repository"].ToString());
        string linkTitle = fieldValue.Description;
        string linkUrl = fieldValue.Url;          

        string repository = linkUrl;
        string ruta = "Shared Documents/Folder"+item;
        //string respository  = "https: //site/teamSite/"
        using (SPSite site = new SPSite(repository))           
        {
            using (SPWeb web = site.OpenWeb())
            {
                web.Folders.Add(ruta);
                workflowProperties.Item["Folder"] = repository+ruta;                   
                workflowProperties.Item.Update();  
            }
        }

    }
4

1 に答える 1

0
 private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
    {
        //Currente item
        int item = onWorkflowActivated1.WorkflowProperties.ItemId;
        SPItem current =  onWorkflowActivated1.WorkflowProperties.Item;    
        //Get url from field
        SPFieldUrlValue fieldValue = new SPFieldUrlValue(current["Repository"].ToString());
        string linkTitle = fieldValue.Description;
        string linkUrl = fieldValue.Url;            
        string ruta = "Shared Documents/Folder"+item;

        using (SPSite site = new SPSite(linkUrl))
        {
            using (SPWeb web = site.OpenWeb())
            {
                web.Folders.Add(ruta);
                workflowProperties.Item["Folder"] = linkUrl + ruta;                   
                workflowProperties.Item.Update();  
            }
        }

    }
于 2013-09-30T15:36:06.683 に答える