Remove old icon and add a new icon

Hi,

There is a db1 icon on serverA. This db1 has been copied to serverB. NowI want to remove the icon db1 fromn serverA and add db1 icon from serverB to the workspace.

@Command([AddDatabase];“serverA”:“db1.nsf”);

@Command([WindowWorkspace]);

@Command([FileDatabaseRemove]);

@Command([AddDatabase];“serverB”:“db1.nsf”)

but this does not work. After running this code db1.nsf from serverA remains on the workspace, but adds db1.nsf from serverB to the workspace.

Please help me. I need to remove the db1.nsf icon from workspace.

Subject: remove old icon and add a new icon.

(copied or replicated).

What we’ve always done is add code to the Database’s PostOpen event that determines if you’re running it on the “wrong server.”

If you are it then runs an agent (lotus script) that removes the current replica ID and opens another replica ID on the proper server.

To remove the icon, we use keybd_event to send the correct key sequence as doing Edit > delete > Yes

I can share the code as I didn’t write it. But if you want to take the above idea and start developing I can “guide you.”

Having said that I’m sure a lot of the ideas probably came from this forum (or 4 / 5) and you can probably find more if you do a search try keybd_event as a search term and see whta comes up.

Subject: RE: remove old icon and add a new icon.

Thanks for your response Stephen.

I achieved what I wanted I am simply running the same code from the Workspace window.