Dear @oleg.k
Thanks for your help
but i don’t understand what what you mean about
but what i mean when i change title value
to any filed in the event doc for example “title”: “color”, it’s show normally on calendar title but that because the color is standard field but the customized field i add it to the document not working what i need is get some information from event doc and display them on calendar title
You mean to display them in event title in calendar? If so, then:
Here you tell calendar, that you want the title of the event to be the value of doc field “test”.
Here javascript is calling python function to get values of doc fields. The function is in frappe/desk/doctype/event/event.py file and the function name is get_events
Check it
You should add to sql statement “select” your custom field name to fetch
Dear @oleg.k
Thanks for your great guide i got it but now i need to display more than one field value but in the event_calendar.js have only one title statement how i can add more than one
@Alaa_Badri, you are welcome! I usually create a custom field (for example, named “calendar_title”) and when saving document filling field “calendar_title” with data from other fields. In event_calendar.js – “title”: “calendar_title”.
That is exactly what i need filling the field (description) from other three fields ( subject (standard field) - Client (custom field) - facilitator (custom field )
@Alaa_Badri, you are welcome. It is a simple script. As for changing colours in calendar, I have some issues in frappe v9.1.10. In my installation calendar understands only field “color”. “color_map”, “style_map” and “get_css_class” are not working for me. Don’t know why. So maybe someone else can help you. Sorry.
Thanks for your response
my purpose is put field values for ( course name , client , facilitator ) int Description field to display it as a title for calendar like we did before with your script but i change facilitator doc type to table to able add more than one facilitator in one Event but i got wrong value in Description field
Dear @Alaa_Badri, sorry for long reply – I didn’t get the notification of your question. if you still need the answer (or for others who also need):
The Table field is an array. You should loop through the table field.
frappe.ui.form.on("Event", "validate", function(frm) {
var facilitators = "" ;
for (item in frm.doc.facilitator) {
facilitators += frm.doc.facilitator[item].facilitator + "-"; // last "facilitator" in frm.doc.facilitator[item].facilitator is the name of the field of Table Doc
}
facilitators = facilitators.slice(0, -1); // remove last delimiter "-"
var custom_description = frm.doc.subject + "-" + frm.doc.client + "-" + facilitators;
cur_frm.set_value("description", custom_description);
}