web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Virtual Entities - 1:N Relationship

(0) ShareShare
ReportReport
Posted on by 480

Hi Everyone,

I have two virtual entities in my Solution named as 

  • Project
  • Issue

Data source is an Odata V4 API I built to retrieve Projects and Issues from JIRA. The issue is I want to have a 1:N relationship between Project and Issue as they are in JIRA. I am trying to add a lookup field of"Project" on my issue entity providing the field having guid of project (projectid) as external name. I save and publish the entity but when I try to access related Issues through Project or Advanced Find I get error as below:

jira1.PNG

If I remove the lookup field, I can access them but I need to show them as related i.e. one project has many issues.

Below is how I created a Lookup field on "N" side of record i.e. Issue

jira2.PNG

Below is my Odata API Meta Data showing both records metadata.

Jira3.PNG

Any suggestions would be greatly appreciated. Thanks in Advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Rizwan,

    Check this article -

    community.dynamics.com/.../dynamics-365-working-with-the-virtual-entities

  • Rizwan Aarif Profile Picture
    480 on at

    Hi Goutam,

    I have already gone through the only (2 articles) including this but it does not seem to work. I don't have issue surfacing data through virtual entities but what I am trying to LINK two virtual entities using 1:N relationship.

    Thanks for you suggestion.

  • TomSmelser Profile Picture
    1,570 on at

    Looks like the field is required in the XML, Nullable="false". In the field definition it is optional. Try making that Business required. I believe that have to be same. Worth a try. Good Luck! Tom.

  • Community Member Profile Picture
    on at

    Hello, 

    I am facing the same issues. Please help me to get through it. 

    I have a CRM Custom Entity "Entity A" and virtual Entity "Advertisement". I have to create a lookup on Advertisement Entity(Virtual Entity) to relate my Custom Entity.

    1. Is it possible?

    Thanks,

    Venkata Pradeep Tumuluri

     

  • vstonape Profile Picture
    6 on at
  • TomSmelser Profile Picture
    1,570 on at

    Hello,

    After some additional trial an error with similar issue I have 2 things to recommend.  This may be a timeout issue, or a bad field name. The problem is the view just errors with no helpful info.

    1.If the view loads when you exclude the lookup column, then try opening a record in the form. Exclude the lookup from the form.  But it seems that even when the lookup is off the form the query will attempt to pull the field. In my case an error occurred but the form produced and XML error that was helpful. There was a misspelling of fields. All External field names have to be exact, down to the case. 

    2.There could be a timeout issue. If you edit your oData datasource there are 2 fields.

    • Timeout: 30
    • Return Inline Count: True

    You can try adjusting the timeout. But the easy test is to adjust the "Return Inline Count" and set it to false. In this case I believe it will only return the Top 50 records. So you may get results but you will lose paging counter in CRM. If you get results then you likely have a db performance issue. 

    Let me know if you have success.

    Best regards,
    Tom

  • vishal bagadia_crm Profile Picture
    490 on at

    Hello Rizwan,

    We have the similar requirement that needs to be implemented and we are kind of stuck. Any help from you would be very appreciated.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans