Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

How to get lookup field Name in SSRS report

(0) ShareShare
ReportReport
Posted on by 392

I have 3 entities, say A, B and C, both B & C are child records (1-N) of A. Entity B has fields looking up to both A(regardingid) and C. In my SSRS i am meant to check in my B Table if C is equals to a particular/specific type of record name, then tick a box. My problem now is, how do i do if (c== "name string" or even an Id). My Fetchxml is below :

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="B" enableprefiltering="1">
<attribute name="Bid" />
<attribute name="name" />
<attribute name="createdon" />
<attribute name="rejectionreason" />
<attribute name="decision" />
<attribute name="Aid" />
<attribute name="Cid" />
<order attribute="ukn_name" descending="false" />
<filter type="and">
<condition attribute="Aid" operator="eq" value="@AId" />
</filter>
</entity>

I am passing @Aid as a paremeter.  Is my fetchXMl wrong here ? , I am currently using this to search entity C in B:

=IIF((Fields!C.Value Like "*The timeline checks and calculations are correct and appropriately evidenced*") AND (decision.Value= "Pass"),chr(254),"o"), but it returns back nothing, with multiple repeating cells. PLease someone with better knowledge help.

Thanks 

  • Suggested answer
    TylerS.Dev Profile Picture
    TylerS.Dev 725 on at
    RE: How to get lookup field Name in SSRS report

    You should download Xrmtoolbox and check your fetchxml statement in fetchxml builder, this will check if your fetxchxml is currectly pulling the result you are looking for.

    I assume your aid is entity a's id.  pulling aid will get you guid of the record instead of the name, if you want to compare name, it should be attribute "Aname", or use "aid" if you are comparing against guid.

    For example, primary contact is a lookup field for owner.

    If you want to check against guid, it should be like

    <condition attribute="ownerid" operator="eq" value="5ddcf667-9c5a-402a-bab9-86cee347b291" />

    If you want to check against name, it should be like

    <condition attribute="owneridname" operator="eq" value="Jack A" />

    Either one will work when you use lookup field as filter condition.

    Please mark as verfied if this resolve your issue.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans