Hi,
I have a date field say customfield_A and a number field customfield_B.
I want to add customfield_A + customfield_B field. Days should be added with the date.
Here is the script i use which does not work.
string format = "yyyy-MM-dd";
date resolved = customfield_A + customfield_B;
if(formatDate(resolved, format) == formatDate(currentDate()+"2d", format))
{
autotransition("status",key,true);
}
The highlighted line is causing the issue.
Below is the error i get,
"Exception while executing SIL program >>Autotransition.sil<<: [SIL Error on line: 3, column: 37] Unsupported PLUS operation between [DATE] "
Please let me know how can i achieve this through SIL script.
Thanks,
Krithica
I was able to do it like this
string format = "yyyy-MM-dd"
interval interv = #{number field Name} * 24*60*60*1000; // number to days
date resolv = #{date field Name} + interv; // add interval
date curDate = currentDate()+"2d"; // add 2 days to the current date
if(formatDate(resolv, format) == formatDate(curtDate+"2d", format))
{
autotransition("status",key,true);
}
You can't add numbers to dates :)See Type casting
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.