I want to make either of the 2 fields as mandatory in a Communication form but somehow the system is not picking the custom script and even if both the CUstomer and Lead are empty the code is making the communication. Kindly let me know if there is any error in the code that I am unable to find, the code is below:
cur_frm.cscript.custom_validate = function(doc) { if(doc.customer ===“” || doc.lead ===“”) { alert(“Either Lead or Customer should be filled in Communication”); system.exit (); } }
–
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
values can also be "null" which is different from ""
On 12-Apr-2013, at 2:29 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi,
I want to make either of the 2 fields as mandatory in a Communication form but somehow the system is not picking the custom script and even if both the CUstomer and Lead are empty the code is making the communication. Kindly let me know if there is any error in the code that I am unable to find, the code is below:
cur_frm.cscript.custom_validate = function(doc) { if(doc.customer ==="" || doc.lead ==="") { alert("Either Lead or Customer should be filled in Communication"); system.exit (); } }
–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
On 12-Apr-2013, at 2:29 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi,
I want to make either of the 2 fields as mandatory in a Communication form but somehow the system is not picking the custom script and even if both the CUstomer and Lead are empty the code is making the communication. Kindly let me know if there is any error in the code that I am unable to find, the code is below:
cur_frm.cscript.custom_validate = function(doc) { if(doc.customer ==="" || doc.lead ==="") { alert("Either Lead or Customer should be filled in Communication"); system.exit (); } }
–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.