私のビジネス オブジェクト (SMS) は、別のモジュールのビジネス オブジェクト (会社) と 1 対多の関係にあります。そこで、モジュール クラスの CustomizeTypesInfo メソッドでこの関連付けを確立しました。
デバッグしたところ、この関連付けが作成されていることは確かですが、会社のオブジェクトをクリックしても SMS リストが表示されません。SMS リストを別のタブで開きたい。どうすればこれを達成できますか?
public override void CustomizeTypesInfo(ITypesInfo typesInfo)
{
base.CustomizeTypesInfo(typesInfo);
ITypeInfo firmTypeInfo = typesInfo.FindTypeInfo(typeof(Firm));
ITypeInfo smsReportTypeInfo = typesInfo.FindTypeInfo(typeof(Sms));
IMemberInfo memberInfoSms = smsReportTypeInfo.FindMember("Firm");
if (firmTypeInfo != null && smsReportTypeInfo != null)
{
XPDictionary xpDictionary = XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary;
XPClassInfo firmClassInfo = xpDictionary.GetClassInfo("crm.net.Module", "crm.net.Module.BusinessObjects.Firm");
if (firmTypeInfo.FindMember("SmsList") == null)
{
AssociationAttribute assoc1 = new AssociationAttribute("Firm_SmsReports", typeof(SmsReport));
xpDictionary.GetClassInfo("crm.net.Module", "crm.net.Module.BusinessObjects.Firm").
CreateMember("SmsList", typeof(XPCollection<Sms>), true,
new AssociationAttribute(),
assoc1);
}
if (xpDictionary.GetClassInfo(typeof(Sms)).FindMember("Firm") != null)
{
if(memberInfoSms.FindAttribute<AssociationAttribute>() == null)
memberInfoSms.AddAttribute(new AssociationAttribute("Firm_SmsReports", typeof(Sms)));
}
XafTypesInfo.Instance.RefreshInfo(firmTypeInfo.GetType());
XafTypesInfo.Instance.RefreshInfo(typeof(Sms));
((XafMemberInfo)memberInfoSms).Refresh();
}
}