How to push parameters to user location documents…


As an administrator, it could be possible to have to update the location documents in the users personal names.nsf.

The following script is a sample which introduce a technique to push new parameters in the user’s location document.

The next step will be to put this in a class to make it more abstract and more reusable.

Enjoy !

Sub Click(Source As Button)
    On Error Resume Next
    Dim db As New NotesDatabase(“”,”names.nsf”)
    Dim view As NotesView
    Dim doc As NotesDocument

    Set view = db.GetView(“($Locations)”)
    Set doc = view.GetFirstDocument
    Dim i As Integer
    i = 0
    Do Until doc Is Nothing
        Call doc.ReplaceItemValue( “Proxy_HTTP”, “10.4.33.180:8080“)
        Call doc.ReplaceItemValue( “WebRetriever”, “3”)
        Call doc.Save( True, True )
        Set doc = view.GetNextDocument(doc)
        i = i + 1
    Loop

    Msgbox “Prox parameter updated. ” + Cstr(i) + ” doc(s) !”

End Sub

Advertisements

About pierrekoerber
Hey, pour faire connaissance, laisse-moi un message... drop me a line.

10 Responses to How to push parameters to user location documents…

  1. Darryl says:

    Hi Pierre,

    I’d like to send users a button to change the home server and mailfile path in their location document. Can you advise if this is possible? Thanks!

  2. Hello,

    Of course is it possible, just use the following replace in the until loop…

    call doc.replaceitemvalue(“MailServer”, xxxxx)
    call doc.replaceitemvalue(“MailFile”, xxxxx)

    perhaps you should lookup to the user document in the domino directory to get the right values… but it is an other story…

    Greetings

  3. Teresa says:

    Hi Pierre,

    wow, thanks for posting that.

    I need to add a sametime server to a location doc, could you help me understand the syntax for doing that pls?

    I’m reckoning that the field I want to add the info to is”SametimeServer” but I am not sure how to use that in your formula to add sametime/Company to the field.

    Many thanks, Teresa

  4. hello Teresa,

    Just change the line

    Call doc.ReplaceItemValue( “Proxy_HTTP”, “10.4.33.180:8080“)

    with

    Call doc.ReplaceItemValue( “SametimeServer”, “ HERE THE VALUE “)

    and replace HERE THE VALUE by the sametime server name… I hope it would help you…

    Bye

  5. Teresa says:

    Thanks so much for that.

    I’m getting errors so can I ask you for a little clarification if I can?
    I opened a new mail – CREATE- hotspot – button

    Then in that screen that comes up, with OBJECT – click referenced on the left and on the right the pane saying NAMEOFBUTTON: click
    run client lotusscript

    I pasted the code and changed that string.

    some of the errors:

    click 3 unterminated string constant – for the first line

    click 7 unexpected”; Expected Operator;,;) – on the line that begins with set view.

    There are other errors too.

    Can I confirm that I am doing it the correct way? Or should I be in designer?

    thanks, T

  6. Hello,

    I tried all that stuff, in fact you have to rewrite the quote, the browser cut-paste changed them to something that LotusScript doesn’t like.

    Rewrite every ” that you find in the code and everything should work fine… good luck…

  7. Teresa says:

    Hey Pierre,

    thanks so much for your help – it works a treat.
    and it has also helped me understand lotus script a bit better – kudos to you!

    Teresa

  8. Domino Devil says:

    but how can we make it specific only to the current location document ???
    I guess the above script would change the values for all the location documents .Is there any condition to check for the current location doc???

  9. Piere says:

    Hi,
    how can i delete other location docs? So only “offline” location is to set.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: