Friday, September 12, 2008

SnTT-Text file registration, part deux

Last week, I posted my woes of trying to come up with a solution to register oodles of accounts in Lotus using a text file and during the registration process also populate the forwarding mail address for those new users. I put out a plea for help and for suggestions on how to overcome this burden and got some great feedback. Then the awesomeness of one Chris Whisonant came through once again with a fantastic suggestion.
When using a text file to create users in the Domino Administrator, there is a field that allows you to enter in a forwarding address. However when the selected Mail system is set to Lotus Notes, IMAP or Pop in the Register Person window, that forwarding field will not get populated into the Person Document during the registration process. Only when you select Other Internet or Other will the Forwarding address field be populated, but the important Domino information is left out. So Chris suggested that instead having the needed Forwarding address information set in that place holder for it in the text file, to instead put the forwarding address into the Comments place holder. And then after the registration process is complete, use a simple agent to copy the address from the Comment field to the Forwarding address field and then another agent to delete the Comments field. With our developers help, we created the agents, I tested it, and it worked. Here's what we did.
You will be using the Domino Designer, I repeat, you will be using the Domino Designer.
You know, that piece of software that we install in case of emergency but rarely venture into for fear it might change us to the dark side. Ya, that's the one I'm talking about.
  • Make a local copy of your companies Domino Directory on your machine. That way if you screw something up it's local and won't replicate back up to the server.
  • Open the copied Domino Directory in, sigh, Designer.
  • Expand the Shared Code section and then click on Agents.
  • Click on the New Agent button.
  • Give this agent a name. For this example I called it copy comment.
  • Click the check box to set the name.
  • Now over on the right where it has the drop down option set to LotusScript, click the down arrow and select Simple action(s).
  • Click on Document Selection.
  • Click on Add Condition.
  • In the pop up box, click on the Condition drop down select by field.
  • Click on the drop down next to Field and select Comment.
  • Leave the field to the right set to contains.
  • In the value field, but an @ sign.
  • When done it should look like this:
  • Click Add.
  • Now click on Action.
  • In the Action window to the right, make sure that Formula is selected from the drop down.
  • Here is where the magic happens. We want to move the information from the Comment field in the person document to the Mailaddress field, which what is used to populate the Forwarding address in the view. Enter in this code that will copy information from the Comment field to the MailAddress field:
  • Once complete, save and close the agent.
  • Now follow the same steps above to create another agent called Delete Comment. It pretty much follows the same logic of looking for things in the Comment field, but in this case we use code to delete entries from the Comment field. I'm sure there is a way to do this all in one agent, but we want to make sure that everything copies the way it should before it is delete. Use this code to delete entries from the Comment field:
  • Save and close the agent.
  • Now, go into your Domino Directory via your Notes client and test, test and test some more before you copy the agents into your production directory.
So there you have it! I know this is not an ordinary type of thing an Admin may come up against, but I thought it was worth sharing in case someone else has a similar situation.

For more information on using a text file for registration, click here

Thanks again to Chris for the ideas and Heidi for being my Sherpa through that Designer thingy.

1 comment:

Perry said...

I just used this code and it worked great, thanks a lot for posting it!

It's a very simple idea, but I wouldn't have immediately thought of it. The real problem is that the user registration function in Designer doesn't allow for a mail forwarding address to be specified.

Thanks again!