Adding a group associate to a server group

Once you have the ServerGroup object that controls the group you want to add group associates to, you can use the ServerGroup.SubGroups.Add method. The method takes one parameter, the ID of the ServerGroup you want to add (see Retrieving the server groups for information on retrieving a ServerGroup). For example, the following function adds a group associate to a given group. Once the group associate has been added, you must call InfoStore.Commit to save the changes to the APS.

Example

function AddGroupAssociate(IStore,ServerGroupId, GroupID)

{

    var ServerGroups = IStore.Query

    ("SELECT SI_SUBGROUPS FROM CI_SYSTEMOBJECTS WHERE SI_ID="+ServerGroupId);

    ServerGroup = ServerGroups.Item(1).PluginInterface("");

    ServerGroup.SubGroups.Add(GroupID);

    IStore.Commit(ServerGroups);

}

Next: Removing a group associate from a server group.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com