Adding a server group is done in much the same way as you add any other type of InfoObject, for example, a user account.
The following function adds a new group to the APS:
function AddServerGroup(IStore, Name, Description)
var PluginMgr = IStore.PluginManager;
var ServerGroup = PluginMgr.PluginInfo("CrystalEnterprise.ServerGroup");
// Create a new InfoObjects collection. This will be used to store the new object
// that will be commmitted later.
var NewInfoObjects = IStore.NewInfoObjectCollection();
// Add the result of the plugin. This will create a new InfoObject that
var NewServerGroup = NewInfoObjects.Add (ServerGroup);
// Set the group's name and description.
NewServerGroup.Description = Description;
// Commit the collection, in which the new group is stored, to the APS.
IStore.Commit (NewInfoObjects);
Next: Removing a server group.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |