The following is instructions how to use AyaScript to create a script that when run, will set all clients “Send client notifications” to False
Please read through all instructions first.
-
Have all users out and and make a backup of your AyaNova database. In the event of a problem, you can restore from backup.
-
Backup your database depending on what configuration your AyaNova is. For example - if your AyaNova database has been installed taking the defaults for stand-alone use you would follow http://www.ayanova.com/AyaNova7webHelp/if_using_the_stand_alone_singl.htm If your AyaNova database has been configured for network use with SQL than you would follow http://www.ayanova.com/AyaNova7webHelp/if_using_the_network_sql_expre.htm etc
3.The web page http://api.ayanova.com/AyaScript/index.htm contains an explanation of use of AyaScript
-
Confirm your AyaNova is the latest version by viewing Help -> About AyaNova (as of date of this posting, latest version is 7.2.0.0 Hotfix 1)
-
Download the same version AyaScript setup file from http://www.ayanova.com/Download.htm
-
Install taking the defaults on your computer where your AyaNova program is already installed - it will be installed to your existing AyaNova folder and will load with your existing AyaNova
-
Run AyaNova
-
Log in as the AyaNova Administrator
-
From the Plugins menu at the very top, drop and select the AyaScript plugin -> which will display the AyaScript editor and existing sample scripts already entered. Select AyaScript Editor
-
Copy all of the script between the two ***************** lines below
-
Paste into the AyaScript Editor
-
Exit out of the AyaScript Editor and save
-
From the Plugin menu, again select AyaScript, which will display the AyaScript editor and existing sample scripts already entered, plus now also Un-notify all clients
-
Select Un-notify all clients - it will internally run the script, setting all clients “Send client notifications” to False. And will notify you when done.
-
When done, check to confirm all clients have their “Send client notifications” set to False.
-
If you encounter an issue, restore from before you proceeded.
//Script created: 5/4/2012 10:17:50 AM
//Name: Un-notify all clients
//ShowInMenuFor: Everywhere
//HandlesAyaNovaTypes: Nothing
public static void AyaScriptMain(bool IsList, RootObjectTypes objectType, Object ayaNovaObject, List<Guid> objectIDList)
{
ClientPickList cpl = ClientPickList.GetList(false);
int ClientsUnNotified=0;
foreach (ClientPickList.ClientPickListInfo i in cpl)
{
Client c = Client.GetItem(i.ID);
if(c.SendNotifications)
{
ClientsUnNotified++;
c.SendNotifications = false;
c.Save();
}
}
MessageBox.Show(ClientsUnNotified.ToString() + " Clients had notification turned on and were switched off.
All done!");
}