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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Save Problem - Please help as I am totally stuck

Status
Not open for further replies.

kennethl

Programmer
Apr 8, 2004
4
GB
I work for a Localization Company. We have a Vendor database which contains record for each of our 174 Vendors. Previously, it was the job of the Vendor Manager to fill out this form - be it over the phone or copying the details from an email or word document. The Vendor form is quite large and because of this a lot fields in the forms were not filled in or only half filled in.

To over come this and to cut down on the Vendor Managers admin time, we decided to open the db out over the that new Vendors could log on and submit a copy of the Vendor form and existing Vendors could also log on, have access to only their details, update the form and submit it for review.

The 'New Vendor' process was no problem, it is with the 'Existing Vendor' process I am having some trouble.

Each existing Vendor is given a unique username and password to log on to the site. Once the user logs on, they are presented with a welcome page. On this page they click on the "Existing Vendor" command button, which opens the existing Vendor form. In order to allow the user to only see their own details, I used an agent in the WebQueryOpen event. In the agent I used the DocumentContext property to pull the users details into the form (I have included a sample of the agent code below)

' instantiate the session object
Set s = New NotesSession

' instantiate the database object
Set db = s.CurrentDatabase

' instantaiate the view object
Set view = db.GetView("va_web")

' set the documentcontext property
Set doc = s.DocumentContext

' retrieve all the documents based on the key array from the view
Set collection = view.Getalldocumentsbykey(doc.GetItemValue("Username")(0), True)

' get the first document from the collection
Set docPerson = collection.GetFirstDocument


' pull general details
Call doc.ReplaceItemValue("vendordocunid", docPerson.GetItemValue("vendordocunid")(0))
Call doc.ReplaceItemValue("vendorupdatedocunid", docPerson.vendorupdatedocunid(0))
Call doc.ReplaceItemValue("vendorusername", docPerson.GetItemValue("vendorusername")(0))

' pull vendor details
Call doc.ReplaceItemValue("Name", docPerson.GetItemValue("Name")(0))
Call doc.ReplaceItemValue("Address_1", docPerson.Address_1(0))
Call doc.ReplaceItemValue("Address_2", docPerson.GetItemValue("Address_2")(0))
Call doc.ReplaceItemValue("Address_3", docPerson.GetItemValue("Address_3")(0))
Call doc.ReplaceItemValue("City", docPerson.City(0))

And now to my problem...
When the user updates their details and clicks on the "Submit" command button, instead of updating the mail document, a new copy of the document is created. Is their any way I can get this to save the updated changes to the main document? I have tried using the WebQuerySave event and the DocumentContext property but this was unsuccessful.

The code behind the "Submit" command button is in formula language:

FIELD Status := Status;

@SetField("Status";"Updated");
@Command([FileSave]);
@Command([Compose];"f_ety")

I am totally stuck with this so any help would be greatly appreciated.

Regards,
Kenneth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top