• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 346
  • Last Modified:

Agent to Update profiles

I have a userInfo form.  

The form keeps the Users information such as  Bldg, Floor, Manager, etc

So I wrote a action button that when you click the button a address book opens, you select the users name, then all the fields in the User form are populated from the address book.  This works well.  The problem is when a user moves or gets a new manager the form is not updated.  So the information is dated.  I woould like to have a agent that would run nightly.

The agent would open each document (UserForm) get the users shortName (field called ShortName) and then update the rest of the fields in the form.

I have a view Named Users that list all the users.

Here is the code in the button

FIELD Username := @PickList([Name]:[Single]);
FIELD ShortName := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "ShortName");
FIELD UFirstName := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "FirstName");
FIELD ULastName := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "LastName");
FIELD UEmail := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "MailAddress");
FIELD Department := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "Department");
FIELD UPhone := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "OfficePhoneNumber");
FIELD UOffice:= @DbLookup("":"NoCache";"domino1/COmpany":"names.nsf"; "($Users)"; UserName; "OfficeNumber");
FIELD UBuilding := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "BLDG");
FIELD UManager := @DbLookup("":"NoCache";"domino1/Company":"names.nsf"; "($Users)"; UserName; "Manager");

Instead of the pickList I want the Value of UserName to be the value in the Username field on the form.

This is very important and I need help as soon as possible.

  • 2
1 Solution
If the Username is already popluated, then  you can simply eliminate the first line with the picklist.

I hope this helps !
JaziarAuthor Commented:
That seemed too simple
Just as a sidebar, and I"m not sure how many documents you are updating, but for a few documents, the formula agent will do the trick, after that you have performance issues and you should abandon the formula for a robust script.

Please see this:

So, while your formula will work, I believe it is inadvisable for updating large number of documents -- over 100, or 200.
JaziarAuthor Commented:
Marilying, I am having some issues with the agent.  I am going to create a new question

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now