Ссылка скрыта от гостей
We have a database that has a replica on 100+ servers. It is being consolidated to exist on one of three regional servers.
So, we needed an email button to send to users that would allow them to pick one of the three regional servers, and then
needed to remove/replace any/all database icons pointing to that replica with the new selected, regional server. We could
not find any code in the forum to assist us when we first looked at this requirement, so I am posting it here for others to
use. Following is the code that does the actual updating of the user's desktop icons. You will have to add code, if you want to
allow the user to select a server from a list, and to allow for users that have no icon at all pointing to a replica of the database.
Keep in mind that the user will be prompted for a "Yes/No" answer when the FileDatabaseRemove is executed.
Код:
vNewServerLocation := "Replace this with the New Server location the user selected";
vRepID := "48256B47002F1DC4";
vIconList := @DbLookup("":"ReCache";"":"bookmark.nsf";"(ByURL)";"Notes:///" + vRepID;"$ReplicaFilePaths");
vCount := @Elements(vIconList);
@For(n := 1; n < vCount; n := n + 1;
@Command( [AddDatabase]; @Left(vIconList[n];"!!") :@Right(vIconList[n];"!!") );
@Command([WindowWorkspace]);
@Command( [FileDatabaseRemove] )
);
@Command([RenameDatabase];@Left(vIconList[vCount];"!!") :@Right(vIconList[vCount];"!!"); vNewServerLocation)