Forcing Attachments but making the error go away when something is attached

I used the following from the https://github.com/webnotes/wnframework/wiki/Client-side-scripting#assign-expected-delivery-date-as-x-days-after-sales-order-date site to setup manatory attachement for several documents but even when I attached something it won't let me save and I get the message. What do I need to change to make the message go away and allow saving after something is attached?


cur_frm.cscript.custom_validate = function(doc) {
    if(!doc.__islocal) {
        if(!doc.file_list) {
            var msg = wn._("Please attach atleast 1 file");
            msgprint(msg);
            throw msg;
        }
    }
}



You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/f86aa5a8-6d3b-4f07-83fa-2b562da6ecd9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hello Nate,

Please post your technical queries on ERPNext Developers Forum.

https://groups.google.com/forum/?hl=en#!forum/erpnext-developer-forum


On Tue, Apr 8, 2014 at 12:03 AM, Nate G <ng...@holoeyesystems.com> wrote:
I used the following from the https://github.com/webnotes/wnframework/wiki/Client-side-scripting#assign-expected-delivery-date-as-x-days-after-sales-order-date site to setup manatory attachement for several documents but even when I attached something it won't let me save and I get the message. What do I need to change to make the message go away and allow saving after something is attached?


cur_frm.cscript.custom_validate = function(doc) {
    if(!doc.__islocal) {
        if(!doc.file_list) {
            var msg = wn._("Please attach atleast 1 file");
            msgprint(msg);
            throw msg;
        }
    }
}



You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/f86aa5a8-6d3b-4f07-83fa-2b562da6ecd9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.





Thanks and Regards,

Umair Sayyed
www.erpnext.com