Maintenance Schedule Script

Hi everyone. I am working with the maintenace schedule and want to write a script to create all maintenance visits automatically from the doc after the maintenance schedule is submitted. I am using the version 13.

(without this option i must select and create each visit manually like the screenshot below.

frappe.ui.form.on(‘Maintenance Schedule’, {

on_submit: function(frm) { //create all visits automatically
  


},

})

could anybody please tell me how is that possible?

Thanks

Usually, I’d start by looking at what that dialogue box calls, it would most likely be a whitelisted function.

The simplest way to implement would be to write a loop and call that endpoint repeatedly with different parameters.


Another better option would be to propose this change in ERPNext. You could add an option called “All” in the scheduled date that would create the visit for all the dates for the selected item.

1 Like

Hi Ankush. Thanks for your time. Is your solution on the client or server side?