SharePoint向InfoPath 2007表单传递参数

来源:互联网 发布:暗黑启示录3破解版java 编辑:程序博客网 时间:2024/06/13 23:56

在调用模板的地方,在链接上增加相应参数。 

添加自定义代码到表单模板的Loading事件,通过InputParameters属性返回Idictionary,并利用其TryGetValue方法获取参数值。当确实得到参数值后,我们可以使用XpathNavigator对象的SetValue方法更新表单数据源中的某个结点值

 

public void FormEvents_Loading(object sender, LoadingEventArgs e) {    string customerId = string.Empty;    try    {        e.InputParameters.TryGetValue("ID", out customerId);    }    catch (Exception ex)    {        customerId = ex.Message.ToString();    }    finally    {        MainDataSource.CreateNavigator().SelectSingleNode        ("/my:myFields/my:ID", NamespaceManager).SetValue(customerId);    }}

 

 

http://soft.zdnet.com.cn/software_zone/2007/0807/446609.shtml