Solved

View selections - tricky one!

Posted on 2000-02-28
7
197 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send a link through lotus notes automated mail 11 134
Add a cc field to email code 3 103
Lotus Domino server 9 7 69
DIIOP IP Addresses Changes Automatically 5 75
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now