Subject: Can this be done? A view question.
Yes, this can be done. Follow these steps:
-
On Project Document, add field “ProjUNID” that is computed when composed. Formula is @Text(@DocumentUniqueID)
-
On Change Document, add same field, with one change…formula is itself: ProjUNID
-
From button (or action or whatever is used to create the Change doc), have it do something like:
dim s as New NotesSession
dim ws as New NotesUIWorkspace
dim uidoc as NotesUIDocument
dim db as NotesDatabase
dim pdoc as NotesDocument, cdoc as NotesDocument
set db = s.CurrentDatabase
set uidoc = ws.CurrentDocument
set pdoc = uidoc.Document
set cdoc = New NotesDocument(db)
cdoc.Form = “ChangeDocument” 'or whatever the name of the form is
cdoc.ProjUNID = pdoc.UniversalID
…then save the new cdoc.
Call ws.EditDocument(True, cdoc)
I think will get you pretty close…I did this without testing it or anything.
Now the view.
First Column…hidden…sorted…formula = ProjUNID
Second Column, sorted, hidden…formula = @If(form = “ProjectDocument”;0;form = “ChangeDocument”;1;2)…this will get it sorted properly.
(note…you could add another hidden column here that sorts by @created…but I will leave that up to you)
Third Column = value from field you want to show for each , maybe the Project Name for ProjectDocuments and Description of change or date of change for ChangeDocument, with maybe the users Common Name showing. Example:
@If(
form = “ProjectDocument”;ProjectName;
form = “ChangeDocument”;" " & Description & " (" & @Name([CN];@UserName) & " added " & @Text(@Created) & “)”
See how far that gets you. If you need any more help, email me: kackster@gmail.com
Good luck.
Note how I faked the indent for ChangeDocuments. I have also made some assumptions on field names, you will have to customize that. Again, good luck.