Greetings Ramlawati,
Updating a response doc is a major headache in most cases. Remember that Notes is not a relation db engine, but a document-centric db engine.
That means that the only data dependancies that exist between documents (even main and response docs) are the ones that the developer creates.
So, if you wish to update the response docs if the main doc is modified, there is just about only one way of doing it and that involves writing script.
Of course, you could eventually implement a lookup formula in the fields you wish to have updated, formula that will replace the current value with the reference value every time the response doc is edited.
Unfortunately, this method is severely limited in two respects :
a) the response doc needs to be edited to be updated, and most doc accesses are in consultation, not modification
b) only the edited response doc is updated, meaning someone has to open and edit all response docs for them to be updated, which means being able to access all docs (not always possible)
The conjunction of these two points means that manual updating is undesireable in most cases, and inefficient at best. An agent-based automatic update is the best solution in every case, the only difficulties being the creation of the agent itself and deciding on the frequency of update checks.
What I would do is first decide what fields need to be tracked to ensure proper updating. You are not going to launch an update process if a field on the main doc (say company telephone number) is not used in the response docs.
So make a list of fields who's info is copied into the response docs and create a Query* script (what I call a Query* script is a functionality implementd in more than one Query event of the form) to check if the value changes between open and close of document.
For example, use the Globals section to declare a variable per field to track, use the QueryOpen event to store the initial values of these fields in the global variables you defined, and use the QuerySave event to retrieve end-edition values and detect a change. If a change is detected, set a flag on the document before saving it.
Then, create a hidden, shared view (called UPDATE for example) which lists the UNID of all docs that have the flag activated. In the previous process, if a change is detected in the fields that are being tracked, a flag is set to something (1, or TRUE, or whatever). Saving that document will ensure that it will show up in the hidden view.
Be sure to have a second, hidden view that lists all response docs (only responses !) by the UNID of the main parent document (in the $Response field). Call it "(LkpResponses)", for example. You need to change the properties of this view to ensure that it does NOT display docs with hierarchy - otherwise nothing will ever display in this view since the parent main docs are missing.
Finally, you can create an agent that checks the UPDATE view for all docs it has to work on. For each of these docs, the agent should check the (LkpResponses) view and make a collection of all docs that have the UNID of the main parent doc. If the collection is empty, the agent loops to the next main doc until the end of the view is reached. Remember to reset the flag on the main parent doc (and save it !) before looping.
Don't forget to ensure that the first columns of your tracking views are sorted, whatever way. Otherwise the agent might have some trouble getting the next doc.
As I said, you're going to spend some time on this. I'm ready to help along the way, so don't hesitate.
Pascal.