We are in the process of writing an agent that will will clean-up a bunch of database’s on our server that use the same template, but database managers made changes that we want to reverse.
Besides Cleaning up the help documents, and folders we are also trying to clean-up agents.
For the agent part we are doing two things.
#1 Check all agents, and if enabled, disable them. Easy enough and working.
The 2nd part that we’d like to do is check the “prohibit design refresh” flag and disable it if it is enabled.
Agent part:
Forall agent In rdb.Agents
If agent.Trigger= TRIGGER_MANUAL Then
Goto nextagent
End If
If agent.Isenabled Then
agent.Isenabled = False
End If
The next part is what I’ve tried, we used this to check folders, but doesn’t work for agents since there is no “view” to capture agents from to get the Items propertie:
Set item = agent.GetFirstItem( “$Flags” )
If Not item Is Nothing Then
pos = Instr(item.Text,“P”) 'see if Preserve is listed
If pos <> 0 Then 'we need to unprotect agents
tmpString$ = Left$(item.Text, pos-1) & Right$(item.Text, Len(item.Text)-pos)
Call agent.ReplaceItemValue(“$Flags”, tmpString$) 'set flags without “Preserve”
End If
End If
nextagent:
End Forall
Any help you can give me would be greatly appreciated!
Thanks,
Shane Meisner