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)

how to filter null lookup field

(0) ShareShare
ReportReport
Posted on by 224

before on the Case entity we dont have field_PersonServiceId and now i want to get all of the Case without the field_PersonServiceId

and i try code like this

var filter = "?$filter=field_Patient/Id eq guid'" + patientId + "' and field_PersonServiceId/Id eq guid'" + null + "'";

and i got an error

Unrecognized 'Edm.Guid' literal 'guid'null''

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Ben Thompson Profile Picture
    6,350 on at

    When an Entity Reference attribute is null the whole entity reference is null so the Id part doesn't exist.

    var filter = "?$filter=field_Patient/Id eq guid'" + patientId + "' and field_PersonServiceId eq null";
    


    should be all you need.

  • KaeL Profile Picture
    224 on at

    Thank you so much sir, i tried that earlier but i put the null outside the " ". this one perfectly works. thanks again. God bless.

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