12/01/08 re-phrasing question to see if I can get a response:
The objective is to be able to categorize 1st column view by multivalue consultant name using all consultant child doc names and display parent request id in a hierarchy in the next column. To accomplish this, I need to have all the child consultant names written back to the parent Request.
Users use a button with embedded assignment view, on the parent Request form to create a child assignment form which houses the consultant name, so the parent request is still open while the assignment form is created. The Assignment form's consultant name has to be written back to the Parent request as a multi-value collection to include all child doc consultant names on save without creating save conflicts with the parent.
Should an agent run after parent doc is saved and closed?
-------------------
Background Info - previously entered:
I have an Assignment Child Form with the Consultant name as a multivalue field that updates the Consultant field in the Parent Request Form.
Input translation for Consultant is as follows in the Assignment Child form:
@If(@IsNewDoc; @Trim(@Unique(Consultant))
;
@IsDocBeingSaved; @SetDocField($Ref ; "Consultant"; Consultant ); Consultant)
Each time the Assignment form is saved, the Consultant multi-value names are written to the parent Consultant field successfully.
I need to be able to retain all Consultant names from all Consultant Assignment docs, so that the view displays multi-value entries as separate values.
Originally, If an additional assignment form was created and saved, it wrote over the Old Parent Consultant field name with the new name, so I created another Parent Request compute Field called Consultant_Dsp to retain all old and new names.
Here is the computed formula for the Parent Consultant field to generate a list of old and new fields in Consultant_Dsp:
@IsDocBeingSaved; @Trim(@Unique(@Name([CN] ; Consultant) )); Consultant ;
FIELD Consultant_Dsp := @Trim(@Unique(Consultant_D
sp : Consultant )) )
Here is the computed formula for the Parent Consultant_Dsp field:
@If(@IsDocBeingRecalculate
d ; @Unique(@Trim(Consultant_D
sp : Consultant )) ; Consultant_Dsp )
This all works as long as you go back and Edit/Save the Parent request to get that last Consultant entry that was last created from the Assignment form save.
Here is an example of the field values in Parent doc:
Consultant: NameD
Consultant_Dsp: NameA, NameB, NameC
I need the Consultant_Dsp field to update & refresh immediately after Consultant is updates, so that it adds NameD wihout having to create another Assignment form which refreshes the Consultant_Dsp field to finally display:
Consultant_Dsp: NameA, NameB, NameC, NameD
Need the Consultant_Dsp to update immediately after Consultant updates without having to open parent request, place in edit mode and save.
I added this script to the qsave in the child Assignment form, but I get the same results.
Can you help me with this script to update the Consultant_Dsp field after the Consultant field is updated : how do I do that - not good at LotusScript:
On query save, I do the following to update the parent doc:
Dim parent As NotesDocument
Dim parentUnid As String
Dim view As NotesView
Set doc = Source.document
If doc.HasItem( "$Ref" ) Then
Set parent = db.GetDocumentByUNID( doc.ParentDocumentUNID )
parent.CTConsultant = CTConsultant
Call parent.ComputeWithForm(Tru
e,False)
Call parent.Save( False, False)
End If
--------------------------
------
Also does someone have a working LotusScript Agent I can use that will Update the existing Parent/child docs with the Consultant and Consultant_Dsp fields - these are new fields so I have to refresh the existing records. I'm having to Refresh the child doc from the view using a refresh agent"
(@Command([ToolsRefreshSel
ectedDocs]
); @Command([ViewRefreshField
s]) ; @All
which successfully updates the Consultant field, but then I have to Refresh the Parent doc so that it updates the Consultant_Dsp field, then go back to the 2nd child doc to refresh, then back to the parent to refresh Consultant_Dsp. It would be nice if I could select ALL Child Assignments and click Refresh from Actions menu that will update Consultant_Dsp each time it updates Consultant sequentially.
I'm afraid that if I run a background agent to do this, I can't see what it's doing or not doing, so at the moment, I need to see how the docs behave after a refresh by selecting a group at a time.
Thanks in Advance for your help !
11/21/08 4:00 p.m.: ok situation is getting worse here - really need someone's help please.
Getting replication save conflicts using the approach above - the user creates a child Assignment doc within the Parent doc while in Edit mode - the Child Assignment view is embedded in the Parent Request and the users use a Create Assignment button within the Open Parent form, so of course a save conflict occurs when writing the Consultant field to parent Consultant field. In cases where the Parent form is just in Browse mode and the user creates an Assignment, no replication save conflict occurs, but the consultant field is not saved back to the Parent request. Thanks again in advance for some insight and a solution.
11/21/08 10:00 p.m.: maybe an agent to run on save to build the consultant collection after the parent form is saved and closed?
Start Free Trial