What is better? Editing core doctype, duplicate it to custom doctype, or create a custom doctype?

I want to change the event core doctype so that when the event is successfully created it will send a WhatsApp message to the participant (we leave aside how to send the WhatsApp), but we know that when we change the core doctype, then in the production server there is no change because the core doctype is in Apps frappe .

Which is better of these 3 choices?

  1. Change the core doctype
  2. Duplicate doctype to custom module
  3. Create a new doctype

You can customize it.
Also there is hooks to add for any event

You can override this doctype and then send a notification/WhatsApp message to the participant in the after_save event.

https://frappeframework.com/docs/user/en/python-api/hooks#override-doctype-class

1 Like

But i want to add custom field that user can choose want to send whatsapp or not on event core doctype, and i dont know what is best solution for this?

I come to this thread since I have a little bit related to this question.
If I want to create a custom function where in the single function it should add new record to 2 different doctype. let’s say:

  1. Create Sales Invoice
  2. Create Sales Invoice Addon Info (custom doctype)

I’m wondering how to do it considering that maybe the process could be interrupted/ error on the step 2, if so, then my Sales Invoice data already created.

In short, i want to know if “after_save” event has “commit” and “rollback” mechanism.

You can add custom fields to an Event Doctype through Customize Form or Custom Fields.
I have added 1 Test field in Event Doctype through Customize Form