Auto-Populate Child Table from Custom Doctype

Hi everyone,

I’ve created a custom doctype named File Manager in my custom app “TestApp”, with the following fields:

  1. Auto Number (System generated)
  2. Reference Date
  3. Reference Number
  4. Project Name (Link to Project Doctype)
  5. Description
  6. Attachment
  7. Confidential (Checkbox)

Additionally, I’ve created a custom child table named File Attachment Table with the following columns:

  • Reference Number
  • Description
  • Attachment

I’ve added this child table to the Project Doctype.

Requirement:

Whenever an entry is created in the File Manager Doctype, the Reference Number, Description, and Attachment fields should automatically reflect in the child table of the corresponding Project Doctype, based on the Project Name.

For example:

  • If I create a record in File Manager with Project Name = Project A, and add the reference number, description, and attachment, it should automatically update the child table in the Project Doctype (Project A) with the Reference Number, Description, and Attachment from the File Manager.

Any guidance, suggestions, or sample code snippets would be greatly appreciated!

Thank you in advance! :blush: