Solved

View selections - tricky one!

Posted on 2000-02-28
7
194 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:sam_clayton
Comment Utility
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
Comment Utility
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
Comment Utility
I have to say I shy away from using profile documents, probably just a personal prejudice.
0
 

Author Comment

by:prenexus
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

7 Experts available now in Live!

Get 1:1 Help Now