Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Virtual entity - account lookup relation

Posted on by 15

Hi all.

I have a question related to virtual entities.

I defined virtual entity "Transaction", which includes data of account transcations from external system.

Every transaction is realted to one account. Virtual entity Transaction includes externalaccountid (string) field, which is also included on account entity. 

How can I create relation between virtual entity Transaction and (real) entity account?

Can i create lookup field on virtual entity to account?

I already saw some samples of making relations between virtual entities. There is no sample of making relation from virtual entity to real entity?

Thanks in Advance...

*This post is locked for comments

  • ocnerf Profile Picture
    ocnerf 135 on at
    RE: Virtual entity - account lookup relation

    Hi David,

    I'm not sure that the solution 1 is correct. The relationship 1:N for non virtual entities to VE seem to be not supported.

    blog.yagasoft.com/.../virtual-entities-work-arounds

    The only possibility is to write a custom data provider.

  • Rizwan Aarif Profile Picture
    Rizwan Aarif 480 on at
    RE: Virtual entity - account lookup relation

    Hi David,

    Is it possible to have 1:N (grid on CRM/native entity) of virtual entities?

    e.g.

    I have project entity in CRM and want to have a grid showing all the JIRA items of that project in a grid in CRM form. There is one common Project Code column in both data source (CRM and Odata source)?

    Thanks in Advance

  • Rizwan Aarif Profile Picture
    Rizwan Aarif 480 on at
    RE: Virtual entity - account lookup relation

    Do you have a number field in your data? If so you can make it a guid.

  • peterstarbek Profile Picture
    peterstarbek 15 on at
    RE: Virtual entity - account lookup relation

    Hi David.

    I understand Option 1.

    But I have case with Option 2. I can't add guid column to the external data set. How can i add dummy guid and how can I write my own provider logic? Could you reference me any example of that kind of provider logic?

  • Verified answer
    David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Virtual entity - account lookup relation

    In CRM, relationships always use the Guid data-type. You have 2 main options:

    1. If you can add a Guid column to the external data set, and populate it with the corresponding accountid, then you should be able to set the relationship based on this field
    2. If you can't add a Guid column to the external data set, I think you can probably create a dummy Guid column, and write your own data provider logic to get the data using the externalaccountid (the string reference) instead
  • peterstarbek Profile Picture
    peterstarbek 15 on at
    RE: Virtual entity - account lookup relation

    Your sample shows relations between two virtual entities. I want to know if it Is possible to create a relationship between a “native”, lets say Account, and a “virtual” entity and how to achive this?

  • Rizwan Aarif Profile Picture
    Rizwan Aarif 480 on at
    RE: Virtual entity - account lookup relation

    Hi Peter,

    You can refer to the below link describing how to relate virtual entities. I too was looking for the same.

    blogs.technet.microsoft.com/.../virtual-entities-relationships

    Let me know if it works for you and mark the answer a "verified"

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans