Once you have obtained the ServerGroup object, you can use the SubGroups property to list and modify the associates that belong to the group. The Servers property returns a GroupAssociates collection, which contains the Ids of all associates in the group and has methods for adding and deleting associates to and from the group. The following segment of code prints the associates of the group in a drop down list. It uses the id of the server group as the value, and the name of the server group as the display string.
for (k=1;k<=ServerGroup.SubGroups.Count;k++)
GroupAssociateID = ServerGroup.SubGroups.Item(k);
("SELECT SI_SERVER_GROUP From CI_SYSTEMOBJECTS WHERE SI_ID=" + GroupAssociateID);
GroupAssociateName = ServerGroups.Item(1).Title;
HTMLTable = HTMLTable + "<option value='"+GroupAssociateID+"'>"+GroupAssociateName;
HTMLTable= HTMLTable + "</select>";
Note: A second query is done to get the name of the group associate.
Next: Adding a server to a group.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |