Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

When automatically generating an adminp request that applies to a specific database, there's an item in the request that you may find hard to create. If you create adminp requests manually and then examine the items in them, you can see for instance that you might have the item ProxyReplicaID with a date/time value. Doesn't look like you would expect a replica ID to look. How do you convert the value of (say) NotesDatabase.ReplicaID, a string, to the TIMEDATE value that gets stored in the note? All the bits are used, so there's a 100ths of a second value that you can't see, but it's in there. Likewise, the timezone is stored in there and has to be preserved.

If you had the value in an item in another document, it would be easy to copy the item to a new adminp request. But if you have to create it from scratch, you need a way to convert a replica ID hex string to a TIMEDATE value.

There is a way, fortunately. The constructor of the NotesDateTime class accepts a hex string as a possible input, so you can just write:

Dim replicaTD as New NotesDateTime(dbTarget.ReplicaID)

docAdminp.ReplaceItemValue "ProxyReplicaID", replicaTD

Though you can't get the NotesDateTime to tell you the exact value to 100th of a second, the exact TIMEDATE value is in there, as you can tell using @Text("ProxyReplicaID"; "*")

Andre Guirard | 7 June 2011 08:15:00 AM ET | Home, Plymouth, MN, USA | Comments (1)


1) Thanks Andre
Brian Benson | 6/8/2011 7:03:26 AM

I can't believe its that easy to do create a PROXYREPLICAID field. This may come in very handy for something I need to do in the near future.

2) Bug in lotusscript when converting ReplicaID can interfere
YCI | 4/2/2014 3:07:48 AM

there is a bug in NotesDatetime that may cause issue with this see { Link }

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact