Saving Form Field Doesn't work

Hello Everybody.

At my formulary, I can save all fields information except the field FORM. I know that the Lotus saves this information on his own, but at my application it isn’t working. I made a script that force the saving of my formulary name and i got nothing.The form is being saved but the field doesn’t. Everytime when the user saves the formulary, this field is always empty. I made the script using formula too, and I got the same result as the first and the saved formulary dessapears on my view.

Can anyone help me to solve this pluzze?

Thanks in advance.

Subject: A couple of things

Are you using store form with document?

Post the code you are using, where you are using it etc.

Is any value being stored in the field FORM?

Subject: Answering…

Carl,

I used to use this field as it would be used, with the Lotus System adding the name of the form. But now, I see that it isnt’ working and I force the Notes to put and save the formulary name.

I tried a lot of thing and scripts, on the QuerySave I got error, cause I was forcing the notes save on this event. Now my code is on PostSave and on the action button.

I’ll post here the codes. I got an idea: at my action button, after it does what it has to do, I try to call an agent, that uses formula, to set up the name of the formulary after its saving. But I have no result, again.

PostSave code:

Sub Postmodechange(Source As Notesuidocument)

dim wks as new notesuiworkspace

    dim doc as notes document

    set Source = wks.CurrentDocument

    set doc =  Source.Document



  if not (docativo is nothing) then

     doc.Form =  "Oportunity"

     call docativo.save(true,true)

     exit sub

End Sub

Action Button Code:

Dim s As New NotesSession

Dim doc As NotesDocument

Dim uiDoc As NotesUIDocument

Dim docui As NotesUIDocument

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim docativo As NotesDocument

Dim dbcur As NotesDatabase

Dim prospecto As Variant





Set dbCur = s.CurrentDatabase

Set uiDoc = Workspace.CurrentDocument

Set docui = Workspace.CurrentDocument





askme = workspace.Prompt (PROMPT_YESNO, "Change Status", "Do you really want to change the status of this document")



If askme = 1 Then

	

	

	Set docativo              					                            = New NotesDocument(dbCur)

'Set docativo = workspace.ComposeDocument(“”,“”,“Opotunity”)

	docativo.Form               				                            = "frmOportunidade"

	docativo.prospect_1 		   				                       = Cstr(uiDoc.FieldGetText("prospect_1"))

	docativo.MeuID                                                           = Cstr(uiDoc.FieldGetText("DocID"))

	docativo.MeuDocID                                                    = Cstr(uiDoc.FieldGetText("MeuDocID"))

	docativo.fatherID                                                         = Cstr(uiDoc.FieldGetText("fatherID"))

	docativo.name=  uiDoc.FieldGetText("name")

[…]

	Call docativo.Save(True,False)

	

	

	If Not (docativo Is Nothing) Then

		

		Dim agent As NotesAgent

		

		Set db = s.CurrentDatabase

		Set agent = db.GetAgent("Change Value")

		

		Call agent.Run

		

		If agent.Run = 0 Then

			Msgbox " Agent ran!"

		Else

			Msgbox "Agent doesn't ran"

			

			Call docativo.Save(True,True)

			

		End If

	End If

	

	

	

	uiDoc.EditMode = True

	Call uiDoc.FieldSetText("prospect","0")

	Call uiDoc.Save

	Call uiDoc.Close

	

	Set docui = workspace.EditDocument( True,docativo)

	

	Msgbox  "Change was successfully performed." 

	

Elseif askme = 0 Then

	Exit Sub		

End If

erro:

'Msgbox "*** Error at button Prospect to Oportunity(CLICK) - Error Number: " + Cstr(Err) + ". Error: " & Error & " line " & Erl

'Exit Sub

End Sub

Subject: This doesn’t sound right

“I used to use this field as it would be used, with the Lotus System adding the name of the form. But now, I see that it isnt’ working and I force the Notes to put and save the formulary name.”

Is anything getting saved in the FORM field? Are you using store form with document?

This isn’t something that just stops working.

Subject: Answering…

No.

The only thing that I put in this field is the name of the formulary (“Oportunity”), after the error message.

The form, is not being used as stored form. The only thing that I want is the appearing of this form on the right view, and it is not happening.

As other attempt, I create this form field. but I got a message telling me that I can’t create another field with same name.

Now, my agent at action button is popping me up a NO RESUME message. I debugged the script but only thing I get is this error, and the debugger don’t tell me where is the line or other thing in the script that is wrong.