How to get the OwnerTargetKey + OwnerSupport

StatusIDPriorityType
Closed34690MajorQuestion
Profile Reply
gabossolo Client

Hi!

Following this example how to get OwnerTargetKey of the owner type (Airline) ?

Contact interface:
public interface Contact : XafariObject, OwnerSupport
{
[PersistentDc] [Browsable(false)] XPWeakReferenceStruct ContactOwner { get; set; }
}

[DomainLogic(typeof(Contact))] public class ContactLogic : DomainLogics.Main
{
public Main(Contact instance) : base(instance) { }

public ContactsSupport Owner
{
get => (ContactsSupport)Instance.ContactOwner.GetTargetObject(Session);
set => Instance.ContactOwner = XPWeakReferenceStruct.SetTargetObject(value);
}
}

==========================
ContactsSupport interface:

[DomainComponent] [NonPersistentDc] interface ContactsSupport
{
[VisibleInDetailView(true)] [Aggregated] [NonPersistentDc] [BackReferenceProperty("ContactOwner")] IList Contacts { get; }
}

[DomainLogic(typeof(ContactsSupport))] public class ContactsSupportLogic : DomainLogics.Main
{
public Main(ContactsSupport instance) : base(instance) { }

public IList Get_Contacts() => GetWeakList("Contacts");
}

==========================
Airline interface:

public interface Airline : XafariObject, ContactsSupport { }

Replies

User Description Posted On
MariyaVoytovich Agent

Hello gabossolo!

I apologize for the delayed response.
The code you sent is not correct.

Please send us the correct code in Attached Files and describe the task in more detail.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossolo Client

It’s OK. Thanks.

× This ticket is closed.

Write US