Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

fetchXML i think its miles away from sql possiblities - Whats the fxml-alternative for Case When,

Posted on by

how to do this with fetchXML??

I mean the CASE WHEN THEN ...

SELECT DISTINCT 

contactid, 
fullname, 
birthdate, 
address1_line1,
address1_postalcode,
CASE WHEN contactid IN @family THEN 'true' ELSE 'false' END AS family, 
CASE WHEN contactid IN @same_address THEN 'true' ELSE 'false' END AS same_address, 
CASE WHEN contactid IN @kundeid THEN 'true' ELSE 'false' END AS contact_started_from

FROM         
FilteredContact

WHERE     
(contactid IN (@choose_contacts_to_show))

ORDER BY 
fullname


*This post is locked for comments

  • Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: fetchXML i think its miles away from sql possiblities - Whats the fxml-alternative for Case When,

    This was already discussed in forum: social.microsoft.com/.../is-it-possible-to-implement-the-switch-case-from-the-following-sql-query-through-fetchxml

  • Peter Bohn Profile Picture
    Peter Bohn on at
    RE: fetchXML i think its miles away from sql possiblities - Whats the fxml-alternative for Case When,

    Hi Rajat,

    No I need to get this working in crm online, cause we moved to crm online and there is only fetchXML allowed. But how can I get this transformed from sql to fetchXML?

  • RE: fetchXML i think its miles away from sql possiblities - Whats the fxml-alternative for Case When,

    Are you working on SSRS here? If so then you will have to add report level conditions like below -

    social.msdn.microsoft.com/.../ssrs-case-statement

    You can find more details about decision function for SSRS here -

    docs.microsoft.com/.../expression-examples-report-builder-and-ssrs

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans