回答
我不得不玩弄它,並在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