What have you defined "database" as?
Try this:
database= new Array(@DbName()[0], @DbName()[1])
var profDoc:NotesDocument = database.getProfileDocument("DbProfile","");
var db = profDoc.getItemValue("CustomiserRepId");
var view = "Custom"
key = "ActivityStatus"
@DbLookup( db, view, key, 2, "[FailSilent]")
I've seen a number of problems with defining "database" and have had problems with it working for local replicas of the database but not for remote replicas. Defining "database" as an array of @DbName with server and database seems to work for anywhere though.