08-28-2015 09:22 AM
I have this weird problem (at least I think it's weird).
I am trying to insert a "Date & Time" into an Autofill using a Unity Script.
The DateTime object is valid and I even do a "ToString()" on the object and display it in the Diagnostics Console.
The object doesn't fill the keyword when I use it in an "Upload Document" and try to autofill.
I try a string with a DateTime.TryParse and that works.
Then I try to convert the original DateTime to a string and back to a DateTime and that doesn't work.
The string is EXACTLY the same as the DateTime Object ToString()
Below is my code:
public void SetKeywordType (Hyland.Unity.Application app, string name, ExternalAutofillKeysetData data, Hyland.Unity.ExternalAutofillKeysetEventArgs args, DateTime datavalue)
{
try
{
KeywordType descType = args.KeywordTypes.Find(name);
DateTime newDT;
string strDT = datavalue.ToString ("MM/dd/yyyy hh:mm:sstt"); // << this doesn't work
//string strDT = "07/07/2015 03:15:56PM"; // << this works
app.Diagnostics.WriteIf (Diagnostics.DiagnosticsLevel.Verbose, "STR DATETIME : " + strDT);
bool success = DateTime.TryParse (strDT, out newDT);
if (success == true)
{
app.Diagnostics.WriteIf (Diagnostics.DiagnosticsLevel.Verbose, "NEW DATETIME : " + newDT.ToString());
Hyland.Unity.Keyword kw = descType.CreateKeyword(newDT);
app.Diagnostics.WriteIf (Diagnostics.DiagnosticsLevel.Verbose, "kwName = " + kw.KeywordType.Name + " " + kw.DateTimeValue.ToString());
if (kw != null)
{
data.SetKeyword( kw );
}
else
app.Diagnostics.WriteIf (Diagnostics.DiagnosticsLevel.Verbose, "Keyword: " + datavalue + " IS NULL");
}
else
app.Diagnostics.WriteIf (Diagnostics.DiagnosticsLevel.Verbose, "ERROR: Could not Parse Date");
}
catch( Exception ex )
{
app.Diagnostics.Write( ex );
}
}
09-02-2015 12:28 PM
if you read my previous comments you will see that I have been testing my results in both the OnBase Thick Client and the testing area of the AFKS dialog box (OnBase Config) and this was working in neither.
One of my coworkers said: "Does it work in the Unity Client?", so I tried it and it worked!
Every date and time worked in the Unity Client.
With that I called Hyland support because this is now beyond an API question.
Hyland says: ". We do parse date values differently in Unity vs. Thick Client. Unity is able to parse DateTime values, while Thick Client just parses Date values."
Argh!
Mystery solved.
Thanks,
Jed K
09-02-2015 07:16 AM
Patrick,
Thanks for the reply.
This is not in any client. This is in an OnBase Unity Script in C#.
I view the results in two places:
1) In the test are in OnBase Configuration in the Setting dialog for AFKS
2) In the Upload window in the OnBase Think Client.
I think the OnBase Configuration Window though tells the whole story. I just see two commas instead of a date time between them.
I am convinced this is a bug in OnBase 13.2.258.
09-02-2015 08:29 AM
My final conclusion (which is a little different than my previous conclusion).
This works:
string strDT = "05/07/2015 10:54:04PM";
This doesn't work:
string strDT = "05/07/2015 6:54:04PM";
The conclusion is that only double digit hours works.
string strDT = "05/07/2015 06:54:04PM"; doesn't work either because this is a date time object not a string.
I don't know what I can do to work around this.
I wonder if this is a known Hyland bug.
09-02-2015 12:28 PM
if you read my previous comments you will see that I have been testing my results in both the OnBase Thick Client and the testing area of the AFKS dialog box (OnBase Config) and this was working in neither.
One of my coworkers said: "Does it work in the Unity Client?", so I tried it and it worked!
Every date and time worked in the Unity Client.
With that I called Hyland support because this is now beyond an API question.
Hyland says: ". We do parse date values differently in Unity vs. Thick Client. Unity is able to parse DateTime values, while Thick Client just parses Date values."
Argh!
Mystery solved.
Thanks,
Jed K
09-03-2015 08:22 AM
09-03-2015 09:30 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.