02-21-2012 06:16 AM
I have a quick question for you guys, it really looks like i'm drowning into a glass of water, but i'm not sure how to properly solve this.
I want to create a 1:1 relationship that is NOT an extension entity. Say, for example, i want to create a relationship from activity to opportunity, so that I can navigate like activity.Opportunity.Satus. Unfortunately i see no way of doing this using proper relationships without turning Opportunity an extension entity of activity, which makes no sense. A a possible workaround would be to create a calculated property in Activity called "Opportunity", which would do something like:
result = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.IOpportunity>(activity.OpportunityId);
I'm wondering if there's an easier way of doing this. Creating calculated properties for each of my 1:1 (non extension) relationships looks like overkill.
Any ideas? I'd really appreciate your insight into this.
Solved! Go to Solution.
02-21-2012 07:28 AM
You can create a many to one relationship. This will allow you to do Activity.Opportunity.Status, etc.
Make sure you create this without creating the reverse relationship, since that will add an activities collection at the opportunity entity which you do not want or need.