升级 Infopath 表单而不保存
我们在 Web 应用程序(不是 Sharepoint)上使用 Infopath 表单。升级表单时,我们在 Windows 7 计算机上的 Infopath 2010 中遇到了问题。
如果我们将新版本的表单发布到我们的服务器,然后在 Infopath 中打开该表单(仅在 Windows 7 上为 2010),则会出现一个黄色信息栏,告诉我们有更新版本的表单可用,并询问我们是否想要“保存并更新”。问题是,这调用了表单的Save
函数,但是如果存在验证错误,则无法保存表单。如果用户在 Infopath 打开后立即单击此“保存并更新”按钮,Infopath 仍会尝试保存空表单。这会导致出现大量错误消息,从而无法提供非常好的最终用户体验。
但是,在所有错误消失并重新打开表单后,它现在具有新版本。
我还注意到,对于某些用户来说,这个错误不会发生,Infopath 似乎只是在显示任何内容之前默默地更新表单。在测试计算机上使用多个本地帐户(包括计算机管理员)进行测试会产生错误,但是当我使用自己的域帐户(具有管理员权限)登录时,我没有收到错误。这让我怀疑问题是由于 Windows 7 中的某些安全设置造成的。
我尝试捕获 Infopath 提供的 OnVersionUpgrade
事件,但该事件直到表单尝试保存后才会触发,所以在这种情况下它对我没有帮助。我还尝试在表单选项 -> 下设置当有新版本可用时自动升级版本控制,但这似乎对表单的行为没有任何影响。
有什么方法可以强制 Infopath 在有新表单可用时自动升级表单,而无需先尝试保存表单?
We are using Infopath forms on our web application (not Sharepoint). We have run into a problem with Infopath 2010 on Windows 7 machines, when upgrading the form.
If we publish a new version of the form to our server, and then open the form in Infopath (only 2010 on windows 7), a yellow information bar appears telling us that there is a newer version of the form available, and asking whether we want to "Save and Update". The problem is, this calls the Save
function of the form, but the form can not be saved if there are validation errors. If the user clicks this "Save and Update" button as soon as Infopath opens, Infopath still tries to save the empty form. This results in lots of error messages appearing, which does not provide a very good end-user experience.
However, after all the errors have gone, and the form is reopened, it now has the new version.
I have also noticed, that for some users this error does not happen, and Infopath seems to just silently update the form before displaying anything. Testing with a number of Local accounts (including the machine administrator) on a test machine produced the error, but when I logged on with my own domain account (with admin privileges) I did not get the error. This makes me suspect that the problem is due to some security setting in Windows 7.
I have tried catching the OnVersionUpgrade
event that Infopath provides, but this event does not fire till after the form has attempted to save, so it does not help me in this case. I have also tried to set Upgrade automatically when a new version is available under Form Options -> Versioning, but this does not seem to make any difference to the behaviour of the form.
Is there any way that I can force Infopath to upgrade the form automatically when there is a new one available, without it first trying to save the form?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题,通过清除本地信息路径缓存解决了这个问题。以前打开过相同表单的用户可能会遇到这种情况。可能是一种在表单加载时以编程方式执行此操作的方法?
I had a similar issue and it was solved by clearing the local infopath cache. Likely happening to your users that have opened that same form before. Might be a way to do that programatically on form load?