Hi, I have three doctypes, I’ll name them and their respective fields to ease use.
- Doctype A
1 Child Table
2 Has two fields : field A and field B ( i.e doc.a & doc.b)
- Doctype B
1 Parent Doctype of Doctype A
2 Two fields : field 1 (a link type field, linking to User), field 2 (table field linked to
Child Table Doctype A)
- Doctype C
1 A simple doctype with three fields: field 1 (A link to User), field 2 (Data Field), field 3 (Data field)
Now what I want to do is, automatically fetch and add rows to Doctype A table in Doctype B whenever I create a Doctype C.
I create a Doctype C and enter the following Data into the Document:
- Field 1 : email@example.com (The link to the User)
- Field 2: “Some Data”
- Field 3: “Some More Data”
Now I create Multiple Documents for Doctype C with different Data entered for Different users. Let’s say there are multiple Documents in which the selected user is firstname.lastname@example.org in Field 1.
What I want to do is whenever I create a Doctype B and Select the User email@example.com in the first field, I want all Doctype C with the firstname.lastname@example.org in the first field automatically added to the table below.
I want the data to be added automatically rather than me linking it to the Doctype itself manually and fetching the Data. I want an automatic prompt to fetch all Documents into the Child table for Doctype C, filtered on the basis of the entered user.
If anyone could cite similar code which I can mould to work for me or link me to a thread where I can find said code Id be very grateful as I’ve searched the threads since long and haven’t found a solution for a problem similar to mine.