Agent to update child document when parent document modified

Hi everyone.

Kindly assist me

I have 2 form in 2 different document…form A is parent and form B is child. so i want to edit document A and i want it also update the document B. because it have the same ID

my system is about training request by employee. first step is HR need to fill in all data about the training session in TRAINING SESSION FORM(date, venue,coursename,price and etc). then the training session will appear in view. then there is second step where employee apply for training request in TRAINING REQUEST FORM. So in TRAINING REQUEST FORM, there is button to SELECT COURSE NAME). when employee click that, it will display all training session created by HR in TRAINING SESSION FORM and when employee select one of the course name, the field value in TRAINING REQUEST FORM will computed from TRAINING SESSION FORM. so my problem is how can i update all field VALUE computed at training request form, if i make changes of value in TRAINING SESSION FORM. every course name have own unique ID. i want to create an agent that can update both document every night.

Subject: Agent to update child document when parent document modified

You can use the Responses property of the NotesDocument class to get all response. Then just update the responses as required.You can also build your own lookup to get the responses for the active document.

Subject: More info

Put the code into the parent’s querySave event so it happens when you save the parent. This works no matter how the doc is saved.

If you have response and response-to-response docs, you’ll need to use recursion. There are tons of examples of this in the Notes 4/5 and 6/7 forums so poke around for examples.