我用 C# 代码制作了一个提交按钮,该按钮从信息路径表单提交到 SharePoint 库。在 infopath 表单中,我有一个字段,您必须键入名称。名称必须始终相同应该生成一个 ID,最后将名称添加为 john 001
、john 002
、john 003
等。
我的信息路径形式:
enter image description here
我在 C# 中提交的代码:
XPathNavigator root = MainDataSource.CreateNavigator();
// Generate a name for the form to be saved in SharePoint
string formName = Guid.NewGuid().ToString();
// Set the name of the form on the data connection
root.SelectSingleNode(
"//my:formName ", NamespaceManager).SetValue(formName);
// Submit the form to SharePoint
DataConnection spConn =
DataConnections["SharePoint Library Submit"];
spConn.Execute();
e.CancelableArgs.Cancel = false;
我该怎么做
最佳答案
string formName = "Kerkesa"+ random(); 我在找这个
在 random() 函数上有一个 GUID 生成器
关于c# - 如何从 infoPath 表单到 Sharepoint 库生成具有唯一 ID 的名称? C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34307473/