I have this code on a button. I want it to broadcast a message to all users if the document has a status on “Unassigned”. The code works great for me but other users can run broadcast because they dont have admin rights. How can i fix this. I tryed putting the code into a agent and then calling the agent and making the agent run on behalf on me. But the agent isnt going through or something i have pasted the code below for that also. THanks in advance.
serverName$ = “server name”
Dim job As String
job = "Broadcast " & |"(!) New Unassigned Called"|
job2 = "Tell adminp process all"
consoleCommand$ = job
consoleReturn$ = session.SendConsoleCommand( _
serverName$, consoleCommand$)
Call CurrentUIDoc.Save
Call CurrentUIDoc.Close(True)
Set agent = _
db.GetAgent("Broadcast")
If agent.Run = 0 Then
Messagebox "Agent ran",, "Success"
Else
Messagebox "Agent did not run",, "Failure"
End If