Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create 2 documents in 2 differents forms based on 1 selected document

Status
Not open for further replies.

Julie845

Programmer
Oct 9, 2003
11
US
Dear all

I'm turning around....
I have a really simple thing todo and I'm not able to find what is my mystake with this

I have a document in a formA
If the status of this form is updated I would like
create a FormB with several items coming from formA and on the same operation, create a FormC (Response to the FormB) with someother items coming from FormA. I have tried using formulas, I have tried using lotusscript without success

Any idea ?

thanks
 
Well, if you showed some of your script, I might be able to get an idea.
Other than that, I can only say that I have worked on many different tasks in Notes, and what seem to require is very possible in Script. Maybe not with Formulas, but definitely should be in Script.
In Script, you can define any number of documents and create them, work in them, then save or discard them. Making one of them a response, and saving another is not difficult.
Post some script, I'll help you sort it out.

Pascal.
 
Pascal

I have fixed my problem this morning, some day as you know you have to do something else and came back later with an open mind.

The only trouble I still have is to delete the original document.
I have tried to use
call doca.remove the system says "not a member: REMOVE

any idea why ?
thanks

julie
 
Congratulations.
Now, you say you wish to use the REMOVE method on a NotesDocument, but the method is no longer part of the object.
I think that, somehow, you have lost the proper object type during processing.
Do you reassign doca at any time in your code ? Do you assign another variable to it, and reassign that one ?
That could explain the error message.
I would step throught the code and watch when doca changes type. That will give you your error.

Pascal.
 
Here you have

As you could see, I have specify a "logical" delete instead of my Remove method

Sub initialize
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doca As NotesUIDocument
Dim docB As NotesUIDocument
Dim docc As NotesUIDocument
Set db = session.CurrentDatabase
Set doca = workspace.CurrentDocument

tempfield1 = doca.fieldgettext("field1")
tempfield2 = doca.fieldgettext("field2")
tempstatus = doca.fieldgettext("status")
...

If (tempstatus = "2. Validation") Then
Call doca.fieldsettext("status","To be Deleted")

Set docb = workspace.ComposeDocument ("", "","form1")
Call docb.FieldSetTex("field1",tempfield1)
Call docb.FieldSetText("field2",tempfield2)
...
Call docb.Save()

Set docc = workspace.ComposeDocument ("", "","form2") Call docc.FieldSetText ("field1",tempfield1)
Call docc.FieldSetText("field2",tempfield2)
...
Call docc.Save()
Call docc.Close

Call docb.close
End If
Call doca.Save()
Call doca.close
End Sub
 
I gather that this is your solution, and you have a view that collects all "To be deleted" docs, with an agent that removes them ?
Good work.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top