Hello ERPNext community,
I’m working on a customization and need some guidance on how to properly implement the following requirements:
- Capturing Sales Person and Location Data:
- On both the
Lead
andCustomer
pages, I want to capture two specific pieces of data:- The parent sales person from the
Sales Person
doctype. - The location of the sales person from the
Employee
doctype.
- The parent sales person from the
- These fields should be automatically populated when the Lead or Customer is created, based on the document owner (i.e., the user who created or owns the document).
- Updating the Captured Data When Document Owner Changes:
- Additionally, if the document owner changes (e.g., the
owner
field of theLead
orCustomer
doctype is updated), the system should automatically update the captured sales person and location data to reflect the new owner’s information. - I’m considering using server-side scripting to handle these updates, but I’m unsure of the best way to implement this efficiently.
Kindly help me with this as it is really important to implement this.