Announcements
Hi,
I'm using SSRS for creating reports but missing how you pull the data from Choice lookups.
For example I have this field <attribute name="cr4fe_servicepaymentterms" /> in my fetchxml, but it is just returning the ID, not the text of the lookup.
thanks
Hello, I was also stucked in this common problem, I was using dataverse, for me what worked is below syntax while displaying the values
for choice field - logicalname.label (here using .value will give you id of the choice)
for lookup field - logicalname.name ( in my case I needed name, you can try other column here)
Thanks,
Hitesh
Thanks Pablo,
This answered my question in a round about way : )
I'm using XrmToolbox to build my query string, however, what I noticed is that the results in XrmToolbox give me the quid value not the lookup value. so when i do this query in toolbox:
<fetch>
<entity name="opportunity" >
<attribute name="ownerid" />
<attribute name="owneridname" />
<attribute name="cr4fe_koboldservice" />
</entity>
</fetch>
I only get these results
But when I run the same query in visual studio, I get both the guid and the lookup text as expected.
Thanks again for your response.
Hi dvcooper,
Indeed when you retrieve a lookup value with FetchXml you'll get a GUID value.
Making a link entity and get the name will work.
But as you are using SSRS notice that 3 field are adding to your DataSet. So pick just cr4fe_servicepaymentterms
please consider marking as an answer if it was helpful
Hi David,
You will not get the name field directly in fetchxml.
You need to outer join the link entity and select the primary attribute from this entity.
You can go to advanced find and then select the column you want into display column and then download the fetch..
An example to show accountnumber from contact having account lookup as company name:
<link-entity name="account" from="accountid" to="parentcustomerid" visible="false" link-type="outer" alias="a_c">
<attribute name="accountnumber"/>
Thanks,
Prateek
André Arnaud de Cal...
293,337
Super User 2025 Season 1
Martin Dráb
232,445
Most Valuable Professional
nmaenpaa
101,158
Moderator