I have a custom script that’s triggered before Submit of a custom doctype and it works fine when the docs are submitted individually. It however appears that Submitting multiple docs via bulk action in list view doesn’t trigger the custom script! Is this a bug?
I found out that bulk submit actually execute the validate trigger, so for your custom code to work on bulk submit, you need to put your code in the validate trigger. Find or create a condition if self._action == 'submit' in validate trigger
You may try server side scripts or you may try hooks. Custom scripts are client side and they are loaded when form is refreshed/loaded/rendered etc. So, most probably your script isn’t loaded thus isn’t executed. I don’t think Frappe will ever let you execute your custom scripts when doing bulk actions.
Thanks a lot for your response. Could you pls explain this a bit more? The condition you suggested seems to be server side. How is this included in the custom script? Pls give a simple example if possible
Yes, this solution works for server side. I haven’t tried with custom script in the client side. Maybe you can be more specific with your code (or put a bit of that custom script here) so maybe we can propose a solution