Solved

View selections - tricky one!

Posted on 2000-02-28
7
200 Views
Last Modified: 2013-12-18
Hey all,

Got a tricky question for you.
Hopefully I can explain things properly!

To start with I am creating a Leave database. We are linked to DB2 to get user information via ODBC. This comes down from DECS using a userid which in turn is derived from the notes.ini (via @environment) - with me so far?

After a leave form is created, I want to the users manager to be able to see that form from a view. For example. I create a leave form using my userid meg03. I want my manager (and only my manager) to be able to see that form in a view so he can approve/reject it.

To be able to get my managers Userid I need my userid - and this only comes out with an Environment statement (@Environment doesnt work in view selections).

Currently, I have a field called Created which is populated with my name (my notes name Mat Egan/SYD/Org so that I can view only my leave requests - this works ok. I cant do the same thing for my manager as I only have his UserID (not his notes name).

Any suggestions would be welcome!

Im toying with the idea of using NotesCollections or something like that. Could I use script to move all the documents that match the criteria into a view that I can create on the fly? What about putting them in a temporary folder and then opening that folder ? How do I accomplish that?

looking forward to some creative suggestions!

Mat

Mat
0
Comment
Question by:prenexus
7 Comments
 
LVL 2

Expert Comment

by:Paebdb
ID: 2567952
Normally the way would be that you build the hierarchy of your organisation with documents in the same or another database.
So you would have a doc for a department, a field in it is the name of the supervisor, and for each employee you have a field with the department name. On this way you can handle flexible future changes in the organisation.
Now when you create your leave doc, you can look up over the department code the name of the supervisor and populate a field in the doc with it, which will also solve your problem with the view.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 2568241
Hi prenexus,

I agree to paebdb's Approach.
Also use Readers Field and change the content of this field dynamically based on the status and username so that that document will be available only for the intended person.

This may avoid unnecessary temporary folders,

Good Luck !

-Arun
0
 

Author Comment

by:prenexus
ID: 2570606
Thanks for the comments.

We have the organisations hierachy in DB2 tables on the mainframe, and we were looking to avoid having duplicate data in Notes as well.

Does anyone have some code that moves things to another folder and then opens that folder?
(For a button from a Navigator perhaps?)

Thanks,

Mat
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Expert Comment

by:sam_clayton
ID: 2591605
We have a HR database in our data warehouse.
I wrote an agent that runs nightly against the database (via ODBC) and updates a manager field in the person's NAB entry (it enters the UNID of the managers person document)
I found this was sufficient to build a structure chart (when the update was expanded to include job titles etc it was even better)
When a person composes a doc for them and their manager it the doc library finds the author in the NAB, get's the manager's person doc unid, then gets that doc and uses that info to fill in the Readers field.
Seems long-winded I know, but it is quite flexible.
(ie you can set up authorisation chains where anyone of management grade above you in company structure can authorise things etc)

cya,
sam
0
 

Accepted Solution

by:
ikke_de_steve earned 150 total points
ID: 2603905
You have to use reader fields, that clear.

In that field you have to put your name and that of your manager(approver).

His name you have to get from a profile document.

You have to create a profile document for each user that use the database.

In that profile document you just place the managers name.

than you can get the profile field by 2 simple functions.

@GetProfileField ("Profiledocument";"Profilefield")
or
@SetProfileField("Profiledocument";"Profilefield"; New value)

in script:

set notesdoc = notesdb.getprofiledocument("profiledocument")

Good luck
Ikke De Steve

PS: This will only work R5.
If not R5, let me know, there is an solution for R4 also. Only a bit more complicated.
0
 

Expert Comment

by:sam_clayton
ID: 2604045
I have to say I shy away from using profile documents, probably just a personal prejudice.
0
 

Author Comment

by:prenexus
ID: 2610218
Thanks for the help!

Ive modified your answer a little bit and dont use a profile document.

Ive got another database which is doing a lookup of the userid and replacing it with the notes name.
For eg meg03 = Mat Egan/SYD/Org

That way I can replace the userids with the managers names and use them as the readers and author fields.

Thanks for the help!

Mat
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question