Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

is it possible to implement the switch CASE from the following SQL Query through FetchXml

$
0
0

I Converted the follwing SQL Query into FetchXml 

SELECT     TOP (1) FilteredQuote.name, FilteredQuote.statecodename, FilteredQuote.totalamount, FilteredQuote.customeridname, FilteredQuote.quoteid, 
              FilteredContact.address1_stateorprovince AS C_State, 
	FilteredAccount.name AS A_FullName, 
                   FilteredSystemUser.address1_line3 AS O_Line3, FilteredSystemUser.address1_postalcode AS O_Zip, FilteredSystemUser.address1_city AS O_City, 
                   FilteredSystemUser.address1_stateorprovince AS O_State, FilteredSystemUser.personalemailaddress AS O_EMail, 
				   CASE FilteredSystemUser.preferredphonecode 
				   WHEN 2 THEN FilteredSystemUser.address1_telephone2 
				   WHEN 3 THEN FilteredSystemUser.homephone
                   WHEN 4 THEN FilteredSystemUser.mobilephone 
				   ELSE FilteredSystemUser.address1_telephone1 END AS O_Phone, 
                      FilteredSystemUser ON FilteredQuote.ownerid = FilteredSystemUser.systemuserid LEFT OUTER JOIN
                      FilteredAccount ON FilteredQuote.customerid = FilteredAccount.accountid LEFT OUTER JOIN
                      FilteredContact ON FilteredQuote.customerid = FilteredContact.contactid
WHERE     (FilteredQuote.quoteid = @CRM_QuoteId)

But i don't how to convert the CASE Statement to FetchXml from the above SQL query

 CASE FilteredSystemUser.preferredphonecode 
				   WHEN 2 THEN FilteredSystemUser.address1_telephone2 
				   WHEN 3 THEN FilteredSystemUser.homephone
                   WHEN 4 THEN FilteredSystemUser.mobilephone 
				   ELSE FilteredSystemUser.address1_telephone1 END AS O_Phone, 


sathishtech.IT


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>