全て、
親グループの子になるグループを追加しましたが、親グループのメンバーになりません。入って手動で設定する必要があります。
これがどのように機能するか知っている人はいますか?
全て、
親グループの子になるグループを追加しましたが、親グループのメンバーになりません。入って手動で設定する必要があります。
これがどのように機能するか知っている人はいますか?
私はそれで遊んで、BOBフォーラムで少し調査をしなければなりませんでしたが、直感的ではありませんが、それを理解しました.
親グループの 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() メソッドを使用するだけでよいと思われることです。これは R3 ではなく BO XI R2 でのみテストされているため、現在のバージョンでは 100% 正しいとは限りません。