How can i add dynamic resources in erpnext calender?

I need to add resources and events in erpnext calender. can anybody explain how can i add dynamic resources in erpnext calender?

You may have to use frappe.get_doc to get the “Event” doctype and then use the insert method to insert the values you wish to.