Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
nraddatz
Posts: 44
Registered: ‎05-25-2011
Accepted Solution

1:1 relationships that are NOT extension entities - possible at all???

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.

Please use plain text.
Copper Super Contributor
gmartinez
Posts: 29
Registered: ‎05-01-2009

Re: 1:1 relationships that are NOT extension entities - possible at all???

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.

Please use plain text.
Copper Elite Contributor
nraddatz
Posts: 44
Registered: ‎05-25-2011

Re: 1:1 relationships that are NOT extension entities - possible at all???

Cool, that solves my issue. I knew i was drowning into a glass of water!
Please use plain text.