Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Compare a lookup field got from a DynamicEntity

(0) ShareShare
ReportReport
Posted on by 2,999

HI, I'm making some changes to the web application e-service accelerator of CRM 4.0

I'm having problems achieving the following..

I have a contact's GUID in a variable called 'Profile.ContactID'

And I have a _caseid variable from which I want to get the 'responsiblecontactid' field of the case

Then I want to check if the 'responsiblecontactid' and the 'Profile.ContactID' are the same.

. This is my code:

DynamicEntity caseRecord2 = DynamicEntityUtility.RetrieveByIdAsDynamicEntity(_crmService, EntityName.incident.ToString(), _caseId, "responsiblecontactid", "statecode", "msa_webportalcloseflag");

Lookup contactoencargado = (Lookup)caseRecord2["responsiblecontactid"];

//THIS IS THE LINE I DON'T KNOW HOW TO WRITE. SEEMS LIKE I CAN'T ACCESS THE ID PROPERTY OF THE LOOKUP LIKE THIS
                //if (contactoencargado.id == Profile.ContactId)
                  {
                    userHasPermission = true;
                 }

 

Please any help will be much appreciated. I'm just getting started with CRM Development.

*This post is locked for comments

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans