从 1 个 sharepoint 2007 列表表单保存到多个列表
我正在处理一份请求表,其中不同的部门需要能够更新它。为了最大限度地减少重叠和丢失的更改,我希望能够将新表单中的数据提交到不同的列表,但我找不到方法来做到这一点。
有人有尝试做类似事情的经验吗?
I have a request form I'm working on, wherein different departemnts need to be able to update it. To minimize overlap and lost changes I'd like to be able to submit data from the new form to different lists, but I cannot find a way to do this.
Does anyone have any experience trying to do anything similar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您熟悉 JQuery 和 SPServices,我可以设想一种方法来做到这一点。
在 EditForm.aspx 中,添加 JQuery 和 SPServices 库。使用 $.(document).Ready 函数,我会使用 SPServices 进行快速项目更新,然后复制具有相同数据的列,因此实际上看起来没有发生任何更改。我会在编辑评论中添加类似“Pseduo checkout to [name], [date_time]”之类的内容。
然后允许用户正常编辑表单,但在您添加的代码中,您捕获 PreSave 操作并检查尝试保存的人员是否与上次修改的相同 - 如果是,则正常保存,否则,在 PreSave 上返回 false 并将被拒绝。当您实际允许保存时,请将编辑注释设置为合理的内容。
要完成此操作,请在执行伪结帐之前检查最后的注释是否不包含伪结帐短语,以便您可以防止任何人在其他人正在进行编辑时打开/编辑表单。
这为列表提供了廉价且相对容易实现的签入/签出。当然并不完美,但在大多数情况下应该都能很好地工作(尽管不在数据表中,所以您可能需要阻止这种类型的编辑)。
If you're familiar with JQuery andSPServices I could envisage a way to do this.
In the EditForm.aspx, add the JQuery and SPServices libraries. using the $.(document).Ready function, I'd do a quick item update with the SPServices and just copy a column with the same data, so in effect no change looks to have taken place. I'd add in the edit comments something like "Pseduo checkout to [name], [date_time]".
Then allow the user to edit the form as normal but in the code you've added, you trap the PreSave Action and check that the person trying to do the save is the same as the last modified - if it is, save as normal, otherwise, return false on the PreSave and it will be denied. When you actually allow the save, set the edit comments to something sensible.
To complete this, check before doing the pseudo checkout, that the last comments don't contain the psuedo checkout phrase so that you can prevent anyone opening/editing the form whilst somebody else is in the middle of an edit.
This gives a cheap and relatievly easy to implement Check-In/Check-Out for a list. Not perfect of course but should work well in most scenarios (not in datasheet though, so you might need to prevent that type of edit).
如果您有两个列表,那么您是否会遇到对同一事物可能有两个请求的问题?
列表的版本控制选项都不能解决潜在的多个并发编辑器的问题吗?
If you have two lists would you not then have the problem of potentially two requests for the same thing?
Does none of the version control options for the list solve the problem of potentially multiple concurrent editors?
虽然 SPService 确实是一个解决方案,但您必须构建自己的 UI。
尝试编写一个事件接收器,它可以在创建项目后立即将其复制到另一个列表。
如果您能说出为什么您确实想在另一个列表中拥有该项目的副本,那就太好了
即审计目的等,您可以在论坛中找到完美的解决方案
While SPService is certainly a solution, but you will have to build a UI of ur own.
Try writing a event receiver, which can copy over item to another list as soon as it is created.
It will be nice if you can tell why you really want to have a copy of item in another list
i.e. Auditing purpose etc. , you can get a perfect solution for this in Forum