Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Update Response documents

Posted on 1999-07-26
5
Medium Priority
?
194 Views
Last Modified: 2013-12-18
I thought that by checking the Formulas inherit values in a response form's properties, the fields will be updated when I make a change in the main document.
But they don't!
How can I force a field in a response doc to copy the value from the field in the main doc every time?

Thanks for your help

Ion
0
Comment
Question by:iamari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
Paebdb earned 300 total points
ID: 1120025
The "Inherit values" option is executed OnCreate, which means that those values are inherited to a field when the document is composed.
If you change something, the changes are not inherited to the child documents.
What you can do is open the child documents, edit and save them, but probably thats not what you want.

The other way to do this is putting some script in the Queryclose event of the parent document.
---
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
     Dim session As New NotesSession    
     Dim db As NotesDatabase    
     Dim collection As NotesDocumentCollection    
     Dim doc As NotesDocument
     Dim runDoc As NotesDocument    
     Dim tempName As NotesItem
     Dim newName As String
     
     Set db = session.CurrentDatabase
     Set doc = Source.Document
     Set collection = doc.Responses
     Set runDoc = collection.GetFirstDocument
     Set tempName = doc.GetFirstItem("Name")
     newName = tempName.Values(0)
     ' change name in direct childs
     While Not (runDoc Is Nothing)
          Call runDoc.ReplaceItemValue("Parent",newname)          
          Call runDoc.ReplaceItemValue("TempParent",newname)                    
          Call runDoc.Save(True,False)
          Set runDoc = collection.GetNextDocument(runDoc)
     Wend
End Sub
0
 
LVL 2

Author Comment

by:iamari
ID: 1120026
Thanks, Paebdb

I've tried it after replacing
Set tempName = doc.GetFirstItem("Name")
with my field name, like
Set tempName = doc.GetFirstItem("Subject")

But it's not working and it doesn't give any error message either.

Anything else I should do?

Ion
0
 
LVL 2

Author Comment

by:iamari
ID: 1120027
I've got it. It worked after I've changed to
    While Not (runDoc Is Nothing)
          Call runDoc.ReplaceItemValue("Subject",newname)          
          Call runDoc.ReplaceItemValue("TempSubject",newname)      

Thanks a lot!

Ion
0
 
LVL 2

Expert Comment

by:Paebdb
ID: 1120028
Did you also substitude the field names "Parent" and "TempParent" with the field names from your child document ?

Call runDoc.ReplaceItemValue("xxxxx",newname)          

Originally my code was not intended to be pasted and run, just to give the idea how it would be done.
0
 
LVL 2

Expert Comment

by:Paebdb
ID: 1120029
Do you have a field "TempSubject" in your child document ? Otherwise you don't need this line.
And you also don't need

 Dim session As New NotesSession    
 Dim db As NotesDatabase      

and

 Set db = session.CurrentDatabase

I just forgot to delete it, sorry.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question