How do I build a CRM SDK QueryExpression where the values of two columns are combined to a new one? In MySQL, my query would look like that:
SELECT *, (`latest_maintenance`+`maintenance_interval`) as `next_maintenance` FROM `servers` ORDER BY `next_maintenance` DESC
In C#, however, I have only managed to do the following:
var retrieveRequest = new RetrieveMultipleRequest();
retrieveRequest.Query = new QueryExpression
{
EntityName = "server",
ColumnSet = new ColumnSet(new[] {"latest_maintenance", "maintenance_interval"})
};
var crmReponse = (RetrieveMultipleResponse) service.Execute(retrieveRequest);
How would I join "latest_maintenance" and "maintenance_interval" to "next_maintenace" in order to be able to use an OrderExpression
?
EDIT: How would I make a simple string-based query for Microsoft Dynamics CRM? Seems like a way easier and more intelligible way than their default one.