Illegal Parenthesized reference: GetDetails

Hi,

I have a form. In that form i have a subform and in the subform i have a Function called GetDetails. I am calling that Function in the QuerySave event. When i open a document composed by that form , i get an error “Illegal Parenthesized reference: GetDetails”. Can anyone help me on this.

I am not using any Script Libraries for accessing the function, the Function is decalred in the Globals of the Subform.

Subject: Illegal Parenthesized reference: GetDetails

You’ll need to post the code for us to help you.

brandt

Subject: RE: Illegal Parenthesized reference: GetDetails

Hi,

The below code is placed in the subform and that subform is placed in the form.

I have declared this function in the Globals of the subform.

Function getdetails(curdoc As NotesDocument,uidoc As NotesUIDocument) As Boolean

Dim CarLine As String

getdetails = True

If curdoc.field1(0) = "" Then

	Messagebox {Please Select field1} , 16 , "Error" 

	Call uidoc.GotoField("field1")

	ValidateDocument = False

	Exit Function

end if

'FACILITY GUIDELINES

If Not curdoc.HasItem("name") Then

	If Cstr(curdoc.name(0)) = ""  Or Cstr(curdoc.name(0)) = "0" Then

		Messagebox {Please enter the name for the area} , 16 , "Error" 

		Call uidoc.GotoField("name")

		getdetails = False

		Exit Function

	end if

	

End If

End Function

Subject: RE: Illegal Parenthesized reference: GetDetails

what about the code that actually calls the function?

brandt

Subject: RE: Illegal Parenthesized reference: GetDetails

It is called in QuerySave event of the subform and some action button in the SubForm

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Source.Refresh

Continue = GetDetails(Source.Document,Source)

End Sub

Subject: RE: Illegal Parenthesized reference: GetDetails

Your problem is here:

If Not curdoc.HasItem(“name”) Then

If Cstr(curdoc.name(0)) = “” Or Cstr(curdoc.name(0)) = “0” Then<–right here

Messagebox {Please enter the name for the area} , 16 , “Error”

Call uidoc.GotoField(“name”)

getdetails = False

Exit Function

end if

If curdoc doesn’t have an item called “name” how can you check to see if it is “” or “0”? It doesn’t exist, so it’s going to throw an illegal reference at you.

Literally, the value of name in that instance is Nothing. It has no value because it isn’t there.

Change that if statement and it should fix your issue.

brandt

Subject: RE: Illegal Parenthesized reference: GetDetails

Hi,

It is not the problem.

I commented the code, but i am having the same problem.

I tried to move the Function from Sub Form to Globals in the Main Form, it is working fine.

But for some other documents its not working.

Please advice.