こんにちは私は、Visual Studio 2015でXAMLデザイナをSITE Bライブラリに配備したSharepointワークフローを開発していますが、別のSharePointサイトAにLinkToDocumentファイルを作成したいと思います。それはプログラムでこのコードを使用していますが、XAMLデザイナツールを使用して別のサイトを取得する方法や、Sharepointワークフローでコードを実行する方法を知りません。私はCodeActivityを使ってみましたが、いくつかのサーバー側の設定を行う必要があり、それを行うことはできません。コードによってVisual Studio Sharepoint 2013ワークフローが他のサイトに接続
:
SPSecurity.RunWithElevatedPrivileges(delegate())
{
//Get SITE A
SPSite site = new SPSite("http://sharepointdomain/sites/siteA");
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true;
SPDocumentLibrary library =(SPDocumentLibrary)web.Lists["MyLibrary"];
SPFieldUrlValue document = new SPFieldUrlValue()
{
Url = "http://sharepointdomain/sites/siteB/" + currentItemName, //Link URL
Description = "Link description "
};
//This class creates the file into SITE A
cratedFile = LinkADocumento.CrearArchivoLinkToDocument(library, "New File Name ", document);
});