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)

Compare a lookup field got from a DynamicEntity

(0) ShareShare
ReportReport
Posted on by 3,013

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

I have the same question (0)

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