Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Using Captured Date as Variable in Dialog Query

$
0
0

Am I being stupid?

I have a dialog with a prompt + response to capture the date which the end-user wishes to retrieve Activities for.  I have tried Response Type as "Date and Time" and "Date Only".

I then want a subsequent "Query CRM Data" step to query ServiceActivities using the captured date as a Variable.

I create the query, where the ScheduledStart ON [today's date].  I then edit the variables, and replace today's date with the stub with the "ResponseText" of the previous step.

When I execute this, it delivers a type conversion error - I have pasted the error log below.  It's expecting a date, but it appears that all responses that are captured during the dialog are text.  How can I fix this?

I am using online 2011

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Expected parameter of type System.DateTimeDetail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Expected parameter of type System.DateTime</Message>
<Timestamp>2013-04-18T14:42:32.1866883Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Plugin Trace:

[Microsoft.Crm.Workflow: Microsoft.Crm.Workflow.Activities.EvaluateExpression]
[EvaluateExpression]

Error Message:

Unhandled Exception: Microsoft.Crm.CrmArgumentException: Expected parameter of type System.DateTime
at Microsoft.Crm.Workflow.Services.ExpressionServiceBase.EnsureParameterType(Object parameter, Type type)
at Microsoft.Crm.Workflow.Services.ExpressionServiceBase.EvaluateExpression(ExpressionOperator expressionOperator, Object[] parameters, Type targetType)
at Microsoft.Crm.Workflow.Activities.EvaluateExpression.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception: System.ArgumentException: Expected parameter of type System.DateTime

</Message>
<Timestamp>2013-04-18T14:42:32.1866883Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>


Viewing all articles
Browse latest Browse all 82002

Trending Articles



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