How can I know the foreign key which links up two entities? I am now using CRM 2011. Thanks so much!!!!!
*This post is locked for comments
Hi Mary,
You can check 1:N relationship in Setting->Customization->Entities->(Entity)->1:N Relationship.
This will show you the linked entities.
In CRM, the foreign key column is always the uniqueidentifier column for link entities. So you can find the same information in relationship details as well.
What exactly are you trying to do? If you are trying to build fetchxml then this can be done in advance find of crm which automatically list down all the relationship.
Thanks,
PS
Hello Mary in JavaScript on the form you can get the foreign key of a lookup by using the following javascript:
Xrm.Page.getAttribute("yourlookupname").getValue()[0].id
You can retrieve data using Fetchxml
Refer this:
Thanks for your answer! What if I would like to query the entities in lookup field? How can I find the foreign key? Thanks!
Refer this also:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156