On loading the Campaign Efficiency report, showing this error
what is the issue? I guess the dates. How to resolve this?
On loading the Campaign Efficiency report, showing this error
what is the issue? I guess the dates. How to resolve this?
Hi @Lone_Wolf
Please select from_date and end_date I hope it works
"default": frappe.defaults.get_user_default("year_start_date")
"default": frappe.defaults.get_user_default("year_end_date")
Thank You!
@Mohammadali Thank you for your reply. But shouldn’t start date and end date auto set on load the report?
And where should I put the code you gave?
@Lone_Wolf JS file in the start_date and end_date fields.
Example
Start Date
{
"fieldname": "from_date",
"label": __("Start Date"),
"fieldtype": "Date",
"default": frappe.defaults.get_user_default("year_start_date"),
}
End Date
{
"fieldname": "to_date",
"label": __("End Date"),
"fieldtype": "Date",
"default": frappe.defaults.get_user_default("year_end_date"),
// "reqd": 1
}
Thank You!
@Mohammadali Thank you for the clarification. I checked the js file and saw the code you gave, its already added. Then Why its howing error? I think the code should like this,
Start Date
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
// default: frappe.defaults.get_user_default("year_start_date"),
default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
},
End Date
{
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
// default: frappe.defaults.get_user_default("year_end_date"),
default: frappe.datetime.get_today(),
},
What do you think about it?