Hi,
In a custom entity im having the customer lookup field, which can have account or contact record. In C#, how to retrieve the data from this customer lookup.
Hi Anandhcrm,
Yes, You are right. Here is the link for more details: Use multi-table lookup columns (Microsoft Dataverse) - Power Apps | Microsoft Learn.
If I answer your question then please mark it as verified.
Let me know if I can provide you with more details.
Thanks
Regards,
Abdul Wahab
Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
Direct/WhatsApp:+923323281237
E-mail: abdulwahabubit@outlook.com
Skype: abdul.wahabubit
Linkedin: www.linkedin.com/.../
But customer lookup logical name is different when we creating rite.. so, it will be changing depends upon either account or contact record ? I am bit confusing.. can you please clarify me ?
Hi,
Try below code
EntityReference customerLookup=(EntityReference)targetEntity.Attributes["lookupfieldschemaname"];
if(customerLookup.LogicalName=="account")
{
Entity accountRecord=service.Retrieve(customerLookup.LogicalName, customerLookup.Id, new ColumnSet("field1","field2");
}
else if(customerLookup.LogicalName=="contact")
{
Entity contactRecord=service.Retrieve(customerLookup.LogicalName, customerLookup.Id, new ColumnSet("field1","field2");
}
Hi Anandhcrm,
What you are trying to write?
These links might be helpful:
If I answer your question then please mark it as verified.
Let me know if I can provide you with more details.
Thanks
Regards,
Abdul Wahab
Power Platform/Customer Engagement Developer/Lead/Solution Architecture/Project Manager
Direct/WhatsApp:+923323281237
E-mail: abdulwahabubit@outlook.com
Skype: abdul.wahabubit
Linkedin: www.linkedin.com/.../
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... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148