is there anyway to get a handle to a document from using the $$ViewTemplateDefault? i have a database that uses this and the documents are just viewed, but now i need to find a way to get a hold of a couple of fields on a document and can’t figure out how. any suggestions would be greatly appreciated.
Why do you need a handle to them? A viewTemplate only formats the view’s output. In the Notes client you can use the UnprocessedDocuments method to get a handle on all the documents currently selected in the view.
On the web it’s trickier. Usually it involves one column of checkboxes and you make an array of all the checkboxes on the form and loop through it to find which ones are selected. Once you do, you get a hold of that document’s UNID hence a “handle” to your document.
we have an old db with our job vancancies out on the web. you can pull up the available jobs and look at the job descriptions. my job is to put our employment application online which will need to inherit the job title and department from the job vacancy. there will be a button on the bottom of each description that composes the internet job application. all of these vacancy views are controlled by the $$viewtemplatedefault, so i really have no handle to the documents and the title/department to inherit onto the application.
If the application is a child of the job vacancy, from the bottom of the vacancy doc, your button could use the URL …/foJobApplication?OpenForm&ParentUNID=JobVacancyUNID. If the application form is a response, is set to inherit values, and has fields computed to the values from the job vacancy you want to inherit, then the parentUNID query string will work.
If you don’t want to have to open a job vacancy doc, then just put a link in a view column for each job vacancy doc.
that’s the way i was originally trying to set it up, but when you use the $$viewtemplatedefault… it seems as if the document is not really open. you don’t see the doc id in the url or anything. i had it working using the parentunid in the url, but that’s with removing the viewtemplate.
I use view template forms all the time and have not had an issue, so I just want to make sure I am understanding your problem…
If you put a UNID field on the top of the vacancy form and compute it to “@Text(@DocumentUniqueID)”, when you open the document from a view on the Web (using the view template), what value displays in the UNID field? If it is the document UNID, then your button formula should just be able to reference this field value to compute the URL for composing the job app. (Although I don’t ususally have to use a UNID field. Usually just @Text(@DocumentUniqueID) works well enough.)