如何在 SharePoint 2007 中强制添加列表附件

发布于 2025-01-05 04:02:45 字数 64 浏览 7 评论 0原文

有人知道如何将附件强制添加到 SharePoint 自定义列表吗? 我们正在使用 SharePoint 2007。

Anyone knows how to make attachment compulsory to the SharePoint custom list?
We are using SharePoint 2007.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

筑梦 2025-01-12 04:02:45

据我所知,用户界面/管理中没有任何东西可以执行此操作。

这篇文章解释了如何使用 jQuery 链接< /a>

编辑以纠正我之前的答案,经过反思,该答案仅提供了部分答案。上面的链接是实现此目的的正确方法。它展示了在NewForm上查询附件详细信息的机制,即:在创建列表项之前,这是可以应用强制功能的点。

There's nothing in the UI / Admin to do this AFAIK.

This arcticle explains how to achieve it with jQuery Link

Edited to correct my previous answer, which on reflection only provided a part answer. The above link is the correct way to achieve this. It shows the mechanism to query the attachments details on the NewForm, ie: before the list item is created, which is the point at which the mandatory function can be applied.

甜味拾荒者 2025-01-12 04:02:45

将以下函数添加为“内容编辑器 Web 部件”中的脚本,或通过 SharePoint 设计器直接添加到表单中。显然,这也需要jQuery。

function PreSaveAction(){ 

    var hasAttachment = false;

    //There are more then one fileupload inputs on the form
    //and one of them will always be blank
    $("input[name^='fileupload']").each(function() {
        if ($(this).val() != "") {
            hasAttachment = true;
        }
    });

    if (hasAttachment){
        return true; //OK to save
    }else{
        alert('An attachment is required!');
        return false; //Prevents user from saving
    }
}

Add the below function as a script in a "Content Editor Web Part" or directly to the form via SharePoint designer. Obviously, this also requires jQuery.

function PreSaveAction(){ 

    var hasAttachment = false;

    //There are more then one fileupload inputs on the form
    //and one of them will always be blank
    $("input[name^='fileupload']").each(function() {
        if ($(this).val() != "") {
            hasAttachment = true;
        }
    });

    if (hasAttachment){
        return true; //OK to save
    }else{
        alert('An attachment is required!');
        return false; //Prevents user from saving
    }
}
清晨说晚安 2025-01-12 04:02:45

更好地创建一个工作流程

,将邮件发送到最后修改者+抄送团队负责人

“如果当前项目有附件=否”发送邮件

Better Create a workflow

which will send a mail to last modified by + cc team lead

"if the current item has attachment = no" send mail

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文