Clearing all group associates from a server group

Clearing all associates is a quick way to remove all the associates added to a server group. You use the ServerGroup.SubGroups.Clear method. The Clear method does not requires any parameters; you only need to query for the server group to clear. The following function clears all the associates from a given group.

Example

function ClearGroups(IStore, ServerGroupId)

{

    var ServerGroups = IStore.Query

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

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

    ServerGroup.SubGroups.Clear();

    IStore.Commit(ServerGroups);

}

Next: Example.



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