I need to know how to get access to a document on the web, I have a button on the web and I need to find a document in the view (with the user’s name, I have the user’s name at this point.) How could I have the document display to the user so that they can modify it if need be on the web…
Subject: need to dispay a document to the user on the web
There are also several other considerations. You need to ensure that the user can access the document (if you are using reader/author fields), and you certainly need to build into the form, methods for editing and saving the document from the web and make sure any validation formula have browser equivalents. Ditto for any form events, particulary the QuerySave/PostSave and QueryOpen/PostOpen events. The question here is, is this application already designed for the web and needs this one additional item, or is it a client application that is going to become a web application?
As far as finding the document via the user’s name, if this is unique (there will only be one), then there are several ways. Getting all documents in a view and cycling them until you find the one with the field with the correct value. This is only a good choice if the view is very, very small in terms of number of documents in the view. If you have a view where the first column is sorted by user name, then you can perform a getDocumentByKey with the user’s name and you will have that document (again, this assumes there is only one document). If there is more than one to be returned, you can get all of the documents from this view using getAllDocumentsByKey, and then parse the returned collection to narrow it down based on other criteria. At the end of the day, you need to:
Determine which document you are looking for based on the information you know at the time you start looking.
Get a handle to the document (using what you know about it and some LS or Java… or possibly even @dblookup/@dbcolumn).
Obtain the document UNID
Build a URL to the document with ?openDocument or ?editDocument
Provide editing/saving methods on the document’s form if they are not already in place.