Link to home
Start Free TrialLog in
Avatar of niccilaw
niccilaw

asked on

How update a person document in the Domino Directory based on form input

I have restricted access to our Domino Directory so that users only have "Reader" access.  However, I want the users to be able to update their contact information on the "Work" tab of their person documents.  I would like to create a form listing the fields on "Work" tab of the person document and provide this form to the users in a database.  

How can I accomplish the following:
1.  When the user creates a document using the form, automatically populate the fields with the current values in the user's person document and allow certain users to change this information on behalf of another user.
2.  After the user makes changes to the field values, save and close the document then have an agent run against these documents and update the users' person document in the Domino Directory using the "Employee ID" as the key.

I am a beginner using Lotusscript so any code you can provide would greatly appreciated.
SOLUTION
Avatar of madheeswar
madheeswar
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of SysExpert
SysExpert
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of qwaletee
qwaletee

FYI to all: No need to "schedule" this.  Instead, have the agent RunOnServer.  It can check the signature of the saved document to verify that the owner or an admin has made the edits, then apply the changes in real time. You can even have the editor DB switch the user to viewing his own Person document in the NAB when done, for instant feedbacl and gratification.

Nice, no?
FYI Pt 2: RunOnServer will work asuming the users are working from the server.  If they are working from a local replica, it will not.
Avatar of niccilaw

ASKER

I am working on implementing your proposed solutions, but I was wondering if you all thought the code should have a way to compare the old person document values with the new ones?  In the form I created, I have a table where the current person document information is displayed on one side and the user can input changes to their person document on the other side.  I tried modifying the code to include a way to compare the values, but I cannot figure out how to compare two variants or convert them to a string so I can compare them.
Why is a compare needed ?

If you populate the fields with the original data, and then update the person doc with new data, why is a comparison needed anywhere ?

I just did not want the code rewriting information that has not changed. Maybe I am overthinking this.  One more thing, one of the fields contains an attachment.  How can I modify the code to update the attachment?  
SInce this  Q has already been answered and closed, I would suggest opening a new Q for this.


1) All teh values from fiels on both sides will be in arrays, you need to (typically) compare element zero of both sides

2) Notes is pretty efficient about the procesisng of changed and unchanged values, so it is probably not necessary

3) You can do it with attachments as well, but that will probably need a bit more specific coding

4) SysExpert is correct, any additional stuff is probably more approapriate in a new Q, but don't sweat that too much