| Back | Main view | Parent doc
How to access IMiS objects without opening Notes document?
Code in IMiS Client subform is not hidden anymore from version 2.4. That allows many new possibilities for developers to change it to meet their requirements. This options are explained in detail in document How to customize IMiS Client subform?. Here we will explain one of this options that is also available in IMiS Design template - how to access IMiS objects without opening Notes document?
You can find view called IMiS View action sample in IMiS template. There is one action called View. This action acan be placed in any view in target Domino application and allows users to open IMiS object from the view. Here is the code:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim SelDoc As NotesDocument
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
If collection.Count <> 1 Then
Call IMiSMessage (SLOMess43, ENGMess43)
Exit Sub
End If
Set SelDoc = collection.GetFirstDocument
result% = IMiSViewObject(SelDoc, 0)
End Sub
The basic idea is to find selected document in view and then to show pop-up list with all IMiS objects in selected document, so that users can view the selected one. If more than one or none Notes documents are selected, code shows the appropriate message to the user - ENGMess43 or SLOMess43 as are defined in IMiSMultiLang script library (see also document Customize interface messages to your native language.
Pop-up list and retrieving of selected object is done by IMiSViewObject function which is implemented in IMSGlobSprem script library. This script library has hidden code so do not resave it, because code will be lost. Declaration of IMiSViewObject function:
Function IMiSViewObject (SelectedDoc As NotesDocument, EditAccess As Integer) As Integer
Return Value:
0 - everything is OK. View process has finished with no errors.
-1 - view process has finished with errors. Most of the errors are reported to user.
- SelectedDoc is the Notes document which has IMiS objects and we want to select one of them from pop-up list
- EditAccess parameter is 1 if user has editor rights on document or 0 otherwise. In this case it is better to leave it 0 so user will open IMiS object as read-only. Even if this parameter is set to 1, user still needs to have rights to edit objects (see Restrictions settings). Editing rights to the Notes document can be determined programatically as it is done in IMiS Client subform under View action - Initialize event of action and Querymodechange event of the subform.
This function can also be used in other places, as long as developer provide valid SelectedDoc and user has at least reader access to document.
| Back | Main view | Parent doc