Date Picker error
Hi, I have a workflow with Date Picker, in the Output Arguments I use "dataStartDate" for "PickDateStart" and "dateEndDate" for "PickDateEnd" and for both variables I use the tpye as "DateTime", it gives the following error message:
Compiler error(s) encountered processing expression "dateStartDate" ("dateEndDate"). Option Strict On disallows implicit conversions from 'Date' to 'String'.
Any ideas on how to fix this?
Thanks.
Sharon
-
Hi Sharon,
What activity in your workflow produces this error message?
If you're attempting to produce something like an alert to show the user the start date and end date you'll need to convert the value to a string first.
Warren
0 -
Hi Warren,
I'm trying to make a report in a time range, so I need to pick start date and end date.
When I put those two "DateTime" type variables into the time picker, then I got this error messages right away.
Sharon
0 -
Hi Sharon,
I can't seem to reproduce the same message that you have indicated. Would you be able to post a screenshot or paste the xaml of your workflow? I'll take a look at it and see if I can figure out whats going on.
Warren
0 -
Here is the screenshot.
/customer/servlet/servlet.FileDownload?file=00P6000000elzbcEAA
0 -
Hi Sharon,
I can't see anything that appears to be wrong in that screenshot, try opening your workflow file with notepad and copy/paste the contents into this thread below so I can open it.
Also can you confirm that the variable type is System.DateTime and not any other flavour?
Warren
0 -
Hi Sharon,
So I opened up the workflow and inspected the variables and a strange thing happened. If I cleared the variables from the Output Argument boxes and re-added them the error dissappeared. I then reviewed the inital xaml again and found that for some reason the Argument Type was set to expect a string variable rather than a DateTime variable (below). So try clearing the box and setting the variable again.
Warren
<gwa:ArgumentWrapper x:TypeArguments="OutArgument" IsRequired="False" Name="PickDateStart">
<gwa:ArgumentWrapper.Argument>
<OutArgument x:TypeArguments="x:String ">[dateStartDate]</OutArgument>
</gwa:ArgumentWrapper.Argument>
</gwa:ArgumentWrapper>
<gwa:ArgumentWrapper x:TypeArguments="OutArgument" IsRequired="False" Name="PickDateEnd">
<gwa:ArgumentWrapper.Argument>
<OutArgument x:TypeArguments="x:String ">[dateEndDate]</OutArgument>
</gwa:ArgumentWrapper.Argument>
</gwa:ArgumentWrapper>0 -
Or remove and recreate the DatePicker form elements.
0 -
Hi Nico,
I made a new one, but it still have same error.
0 -
Use a different name for the argument, or use Warren's solution.
0 -
I started in a new, blank workflow and just added a single DatePicker form. When I try to assign the Output Arguments of the DatePicker to a System.DateTime format, I get the following error:
"Compiler error(s) encountered processing expression "dateTest".Invalid L-Value expression.; Reference expresions cannot end with Conversion. The provided expressions type must exactly match the type T of the VisualBasicReference<T> or LamdaReference<T>."
Do I need to use a different format for the DatePicker Results?
0 -
To (https://support.geocortex.com/ProfileView.aspx?userid=11181) xiaoyun.zhao
The Output argument for the DatePicker Form control on DisplayForm expectes its Variable Type 'System.Nullable<System.DateTime>', rather than 'System.DateTime'.
As the tip, when you create a variable for the Ougument, you may use 'Create Variable'.
1) Check if 'Enable Intellisense' is off on Edit menu on Workflow designer
2) Mouse focus on the Textbox for the output argument you want to creater variable for on DisplayForm, and type 'c', which will show 'Create Variable' suggestion.
3) Select and click 'Create Variable', which will popup UI where you can set the Varibel Name and it will show you the correct Variable Type for the Display Form control.
Munhwan
0 -
It works now. Thank you so much.
0 -
Munwhan Gim was just the ticket! Very easy fix! Thanks for saving me this headache!
0 -
+1 0 -
Yes, I was going crazy trying to figure this out. I would have NEVER guessed system.nullable<system.datetime> 0
Please sign in to leave a comment.
Comments
15 comments