Mandatory Attachment

38 views
Skip to first unread message

Nate Gallery

unread,
Apr 14, 2014, 6:57:17 PM4/14/14
to erpnext-dev...@googlegroups.com
I used the script form github to make attachments mandatory but not even when something is attached the error message comes up and it won't let me save anything. What am I doing wrong?

Anand Doshi

unread,
Apr 15, 2014, 2:16:10 AM4/15/14
to Nate Gallery, erpnext-dev...@googlegroups.com

Nate,

You need to share your code and the error message via pastebin or gist


Thanks,
Anand Doshi.

On 15 April 2014 at 4:27:20 am, Nate Gallery (galle...@gmail.com) wrote:

I used the script form github to make attachments mandatory but not even when something is attached the error message comes up and it won't let me save anything. What am I doing wrong?
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8591cee7-c7a8-485c-a888-65ccde72c149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nate Gallery

unread,
Apr 17, 2014, 2:35:48 PM4/17/14
to erpnext-dev...@googlegroups.com, Nate Gallery
I used the following code:

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;
        }
    }
}

And I get the error code please attach at lest 1 file even when something is attached.


On Monday, April 14, 2014 11:16:10 PM UTC-7, Anand Doshi wrote:

Nate,

You need to share your code and the error message via pastebin or gist


Thanks,
Anand Doshi.

On 15 April 2014 at 4:27:20 am, Nate Gallery wrote:

I used the script form github to make attachments mandatory but not even when something is attached the error message comes up and it won't let me save anything. What am I doing wrong?
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Nate Gallery

unread,
Apr 17, 2014, 2:49:28 PM4/17/14
to erpnext-dev...@googlegroups.com, Nate Gallery
More specifically I used:

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;
        }
    }
}

This does give the error message when nda_expiration_date is populated but when I do attach something the message still comes up.

rushabh

unread,
Apr 21, 2014, 2:33:51 AM4/21/14
to erpnext-dev...@googlegroups.com, Nate Gallery
In version 3, to get attachments in the current form doc:

cur_frm.get_docinfo().attachments

Run this in your js console to see what comes up.
Reply all
Reply to author
Forward
0 new messages