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
LeadandCustomerpages, I want to capture two specific pieces of data:- The parent sales person from the
Sales Persondoctype. - The location of the sales person from the
Employeedoctype.
- 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
ownerfield of theLeadorCustomerdoctype 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.