SendConsoleCommand and Broadcast

Hi,

I am supposed to design a form button that when clicks (to submit the form), an alert will pop up on a Notes user session (like new mail alert) specified on that form. I think about using session SendConsoleCommand to Broadcast . Here is (part of) my code in the QuerySave for that button


PopupMessage = "Broadcast " & " (!) New Phone Message for you " & doc.MessageFor(0)

	PopupReturn$ = session.SendConsoleCommand(servername,PopupMessage)

where:

doc.MessageFor(0) = Notes ID of the intended user

and

servername = name of the server (form is runing on the same server)

Here are my questions:

  1. I ran the script in Debug Mode and when it get to the PopupReturn, I saw the value as error "Too many arguments. Enter “HELP” for the correct syntax - I check the Designer help for Broadcast and I could not figure out what I did wrong. Help please! For the sake of testing, I hardcoded the username and got NO error. I tried other ways like:

PopupMessage = “Broadcast " & |” (!) New Phone Message for you "| & doc.MessageFor(0)

but same error.

Please, please help with syntax for Broadcast.

  1. Is this the correct way to do the popup since SendConsoleCommand requires users to have “Full Remote Console Adminstrators” and all users using this database can not have that? What is the alternative?

  2. I checked out postings on this forum about this topic - most recommended to do run this SendConsoleCommand on an agent that does RunOnServer. It seems to work here as code on form QuerySave since when I checked out the Server log I saw :

Broadcast " (!) New Phone Message for you "Hung Tran/USAAD

Too many arguments. Enter ‘HELP’ for the correct syntax.

11/07/2008 09:49:38 AM Remote console command issued by Hung Tran/USAAD: Broadcast " (!) New Phone Message for you "Hung Tran/USAAD

What should I do? Put this code in an agent or is OK to leave them on the Form QuerySave?

Many thanks in advance for your help.

Subject: SendConsoleCommand and Broadcast

Have you tried

“Broadcast " & |” (!) New Phone Message for you: | & doc.MessageFor(0) & |"|

?

Subject: RE: SendConsoleCommand and Broadcast

Thanks Bruce. It works fine! Thanks again.