Simple lotusscript button

Could you please tell me why this simple agent does not create a new location document in “”,names.nsf

Sub Initialize

Dim db As NotesDatabase

Dim doc As NotesDocument

Set db = New NotesDatabase (“”,“names”)

Set doc = New NotesDocument( db )

doc.Form = “Location”

doc.name = “mail in database”

Call doc.save (True, True)

End Sub

Subject: Simple agent help

The document was saved but don’t appear in the Location view because the View Selection is:SELECT Type = “Location”

Create a field Type with value “Location”

doc.Type = “Location”

Subject: Simple lotusscript button

Use the GetDatabase method of NotesSession to retrieve the database.