ERPNext Conference 2019* ERPNext.com Blog

How to execute my Javascript code in project

erpnext

#1

I want to make a counting number of years in Frappe. Now I try to understood How i need to point the path in python
my javascript file:
frappe.ui.form.on(“Lead”,“date_of_birth_add”,function (frm) {
alert(‘fsda’);
frm.set_value(‘age’,
});
my hooks.py:
doctype_js = {
“Quotation” : [“erpnext_safer/erpnext_safer/custom_scripts/date_validation.js”],
“Lead”: [“erpnext_safer/erpnext_safer/custom_scripts/years_counter.js”]
}


#2

It looks like date_of_birth is a Date field.

Use date_of_birth, instead of date_of_birth_add