回答
我不得不玩弄它,并在BOB Forum上做了一点研究,但我想通了,虽然它不直观。
我打算假设你知道如何获得父组IUserGroup对象。
// get the plugin manager
IPluginMgr pluginMgr = store.getPluginMgr();
// Retrieve the User plugin.
IPluginInfo groupPlugin = pluginMgr.getPluginInfo("CrystalEnterprise.UserGroup");
// Create a new InfoObjects collection.
IInfoObjects newInfoObjects = store.newInfoObjectCollection();
// Add the User plugin to the collection.
newInfoObjects.add (groupPlugin);
// Retrieve the newly created user object.
IUserGroup newUserGroup = (IUserGroup)newInfoObjects.get(0);
// build the new group
String newGroupName = "My Test Group";
newUserGroup.setTitle(newGroupName);
newUserGroup.setDescription("Just for sample test code");
store.commit(newInfoObjects);
// now that things commited associate the parent group
if(parentGroup != null)
{
parentGroup.getSubGroups().add(new Integer(newUserGroup.getID()));
store.commit(parGroupObjs);
}
大的问题是,你会希望只使用setParentID()方法。警告这个词只在BO XI R2下测试,而不是R3,因此它对于当前版本可能不是100%正确的。
我要测试一下。我正在查看getSubGroups,但是它的API文档没有出现在我身上。我会让你知道的。 – XanderLynn 2010-03-06 16:38:12
像XI R3的魅力一样工作。谢谢! – XanderLynn 2010-03-07 17:09:54
我同意API文档不会为此而弹出,我真的不得不感谢BOB论坛来找出答案。 很高兴知道它适用于R3,因为我们刚刚开始升级(尽管目前不使用它)。 – shrub34 2010-03-08 14:23:39
- 1. shinydashboard header dropdown add group links
- 2. sql group by count and add totals row
- 3. AngularJs ng-repeat group group
- 4. sql group by sub group
- 5. GROUP
- 6. Group By XSLT 1.0,group of groups
- 7. GROUP BY
- 8. Group Gtk.RadioToolButtons?
- 9. Group MenuItem's Items
- 10. Bootstrap btn-group里面form-group和border-radius
- 11. group by mysql option
- 12. Group Position allways 0
- 13. 在OpenShift中“oc adm policy add-role-to-group”是什么选项-n?
- 14. ADFS Multiple Group
- 15. group by clause
- 16. Rails Group By Query
- 17. SQL Group by“Like”
- 18. SQL Group by concat
- 19. SQL select/group
- 20. mysql group by confusion
- 21. Guava Group按键
- 22. Group By with Where
- 23. Rails group by order
- 24. SQL Percentage Group By
- 25. jqGrid Column Group
- 26. SQL Query GROUP LIKE
- 27. SQL GROUP BY CLAUSE
- 28. sql group by season
- 29. GROUP BY在SQL
- 30. Git Group Workflow
这是用于用户组的吗? – shrub34 2010-03-05 15:27:36
是的我试图添加一个用户组成为另一个用户组的成员。 – XanderLynn 2010-03-05 17:20:07