Write custom server side code in custom_validate() method. The function gets executed before saving the doc.
For throwing a validation message, use webnotes. throw() method, it will raise exception and stop further processing.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
In custom script with script type as server.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
--
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 a topic in the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/pXgAlzzjkek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
HI Rushabh,
Thanks for reply. Yes, I am aware of importance of tab. Normally the system gives error if there is any issue with code indentation. I don't see any error in console. See below link for the gist code. I haven't used gist before so not sure what I have done below is correct or not.
https://gist.github.com/mayur-patel/6914969
PS: On server I don't see any support for custom_validate. I did grep for custom_validate on server but I didn't find anything except a mention of it in a readme file.
Kind regards,
MP
On Thursday, 10 October 2013 09:15:44 UTC+1, rushabh wrote:Mayur - please post your code in gist / pastebinthe padding is important - the code must be padded by one tab.
On 10-Oct-2013, at 1:44 PM, MP <mayur....@gmail.com> wrote:
--
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.