我有一个infopath表单。在To Field的更改事件中,我正在更新另一个名为Shift的字段的值。为此,我写了以下代码。
public void To_Changed(object sender, XmlEventArgs e)
{
// Write your code here to change the main data source.
///my:myFields/my:RequestDetails/my:IndividualRequest/my:To
// Write your code here.
// Write your code here to change the main data source.
///my:myFields/my:RequestDetails/my:IndividualRequest/my:To
try
{
XPathNavigator xmlDoc = this.MainDataSource.CreateNavigator();
XPathNavigator xTo = xmlDoc.SelectSingleNode("my:myFields/my:RequestDetails/my:IndividualRequest/my:To", this.NamespaceManager);
XPathNavigator xShift = xmlDoc.SelectSingleNode("/my:myFields/my:RequestDetails/my:IndividualRequest/my:Shifts", this.NamespaceManager);
xShift.SetValue("6");
}
catch (Exception ex)
{
Log.WriteLog(ex);
}
}
我已发布表单并将表单上传为contenttype。但是当我在infpath表单中更改To值时,Shift Field值不会更新。
答案 0 :(得分:0)
我已经使用infopath中的规则解决了这个问题。