Skip to main content

Greetings,

 

I'm having a problem with the Calendar control and from what i've been browsing it's not something new. 

I have a Calendar Control which is used to store a birth date on a form. Such form has a workflow associated that shows me the previous date (the one on the SmartObject instance) and the new date (the one on the control). I'm storing the new Date on a Workflow's Data Field and it's set as null. The problem is that if the control is empty, whenever i try to start the workflow i get the error: "String was not recognized as a valid DateTime.". I might be mistaken but it seems that K2 is sending an empty string to k2 Studio which is causing such error. The control's default value is set to "Empty". I know that i could switch the Data Field to String instead of DateTime but i want to compare the dates along the way.


Has anyone faced such a problem before?

Best Regards.

Dear,

 

Good point to notice , i honestly havent noticed it before ,

but as a resolution i might suggest couple of ideas ,

first is the one  u already said , u could change the data field into string , and when ever u want to compare it with another date , u could convert it first , if u perform the comparing inside the workflow process u could use functions to convert it then compare it , so is for forms comparing , or as i do believe that if u retrieve that string into calendar control inside ur form , it will convert it by itself into date then u could perform the compare u need .

 

second idea , is that the problem u r facing happens when u leave the calendar empty , then it sends null as a string , which doesnt suit ur process data field ,

would it solve ur issue if u create an expression , to check whether the calendar is empty or not ? and if its empty , just send a dummy date/time ?

maybe an expression like , if Calendar is empty , (01/01/1753) else , (return the calendar value) .

 

Hope it helps!

Regards

Ahmad Yaqub.


Reply