I have created a report using fetch-xml query for Microsoft Dynamics CRM Online. In this field, I have created a custom enity which has "Last Accessed Date Time" field of type "DateTime". This field stores the value in GTM. I am retrieving the value of this field using fetch-xml query. Also, I want to calculate the difference between the current DateTime and the value (in the locale and not in GMT) of this field in "Hours Minutes Seconds" format. I have written an expression for the same in reportas follows.
(IIF(((INT((DateDiff(DateInterval.Second, DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value), DateTimeKind.Utc).ToLocalTime(), DateTime.Now))/60))>60), INT(((((DateDiff(DateInterval.Second, DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value), DateTimeKind.Utc).ToLocalTime(), DateTime.Now)))/60)) / 60), 0))
& "Hours"&
(IIF(((INT((DateDiff(DateInterval.Second, DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value), DateTimeKind.Utc).ToLocalTime(), DateTime.Now))/60))>60), INT((((DateDiff(DateInterval.Second,DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value), DateTimeKind.Utc).ToLocalTime(), DateTime.Now)))/60) Mod 60), INT((DateDiff(DateInterval.Second, DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value), DateTimeKind.Utc).ToLocalTime(), DateTime.Now))/60)))
& "Minutes" &
((DateDiff(DateInterval.Second, DateTime.SpecifyKind(DateTime.Parse(Fields!new_lastaccesseddatetime.Value),
DateTimeKind.Utc).ToLocalTime(), DateTime.Now)) Mod 60)
& "Seconds"
This works fine in visual studio. But, when tried to upload the same report in CRM Online organization, it gives the following error.
Any idea how to solve this issue?
*This post is locked for comments