如何将现有字段信息添加到新添加的infoPath文本框中? [英] How to add existing field information to a newly added infoPath textbox?

查看:115
本文介绍了如何将现有字段信息添加到新添加的infoPath文本框中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我向表单中添加字段时,如何在旧字段的基础上预填充InfoPath表单中的新字段.

How to pre-fill new fields in a InfoPath form base on the old fields, when I add a fields to a form.

在我的InfoPath表单中,我有一个名为"Description"的字段名称.现在,我添加了另一个字段:"SummaryDescription".假定从描述"字段中获取前10个字.

In my InfoPath form I have a field name called: "Description". Now I added another field called: "SummaryDescription". Which is suppose to take the first 10 words from the Description field.

即使我添加了字段和逻辑,SharePoint数据库中的现有表单数据也不会被修改.

Even though I added field and the logic, the existing form data in SharePoint Database does not get modified.

修改

@PatrickPitre

@PatrickPitre

非常感谢您的快速回复.

Thank you very much for the quick response.

我正在处理基于Web的InfoPath表单(Forms Services).是的,我的计算机上确实安装了Visual Studio 2008.

I'm dealing with a web-based InfoPath form (Forms Services). Yes I do have Visual Studio 2008 installed in my computer.

我需要做的一件事是修改现有的基于Web的InfoPath表单,这是在旧表单中添加另外三个字段.添加字段后,当用户单击Sharepoint中现有的表单时,需要确保这些新添加的字段不为空.我必须在现有字段中使用前200个单词说"Description",然后将其插入新字段"SummaryDescription".

One of the things I need to do is to modify existing web-based InfoPath form, which is to add three more fields to the old one. Once I add the fields I need to make sure those newly added fields are not blank when the user click on the existing form that is already in the Sharepoint. I have to take the first 200 words in the existing field say "Description" and plug it into the new field "SummaryDescription".

到目前为止我所做的:

  1. 我将这三个新字段添加到了基于Web的InfoPath表单中,并将其发布到一个测试服务器中.我可以在现有表单中查看新添加的字段.

  1. I added those three new fields to the web-based InfoPath form and published into one the test server. I'm able to view the newly added fields in the existing form.

我正在尝试使用InfoPath中的Rule来帮助我实现需要做的事情.我检查新添加的字段是否为空白.如果是,则使用"SummaryDescription"中的字段并添加的值.

I'm trying to use the Rule in the InfoPath to help me achieve what I need to do. I check whether or not the newly added fields are blank or not. If it is then take the fields in "SummaryDescription" and add the value of .

这是代码:

concat(
substring((string-length(Description)), 1, ((string-length(Description)) <= 200) * (string-length(Description))), 
substring(number(201), 1, (not(string-length(Description))) * number(201))
) 

但是我根本无法将值添加到该字段中.

这是我所做的屏幕截图.

This is the screen shot of what I did.

我尝试了许多不同的方法.而且我很确定"SummaryDescription"为空白,但我无法显示该值

I have tried many different ways. And I'm pretty sure "SummaryDescription" is blank but I just could not get the value to display

"Sharepoint数据库"是什么意思?我认为基于Web的InfoPath表单中的所有内容都存储在某种数据库中.如我错了请纠正我.

What do I mean by "Sharepoint Database"? I thought that everything in the web-based InfoPath form is store in some kind of Database. Correct me if I'm wrong.

非常感谢.

推荐答案

仅通过扩展InfoPath表单的架构和逻辑不是,就意味着将存在任何现有数据(填充表单) 自动升级.

Just by extending the schema and logic of an InfoPath form doesn't mean any pre-existing data (filled forms) will be automagically upgraded.

您有几种选择

  • 使用XSLT或自定义升级应用程序处理现有XML表单以转换XML;
  • 使用 VersionUpgrade 表单代码后面的事件,以执行任何升级步骤.
  • Process the existing XML forms with XSLT or a custom upgrade application to transform the XML;
  • Make use of the VersionUpgrade event in the form's code-behind to perform any upgrade steps.

主要区别在于,在第一种情况下,您可以进行批量升级,而在后一种情况下,则可以在打开现有表单时根据需要进行逐个升级.

The principal difference is that in the first case you can make a batch upgrade, while in the latter case it's case-by-case on-demand upon opening an existing form.

这篇关于如何将现有字段信息添加到新添加的infoPath文本框中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆