AnsweredAssumed Answered

SIS Snapshot Flatfile DI Custom Script Start Date

Question asked by PJacobs on Sep 28, 2017
Latest reply on Sep 28, 2017 by PJacobs

Hello,

I am trying to use a custom script option in a SIS Snapshot Flatfile DI to set the start date value from information set from another field, i.e institution_name.

 

I have the code to get the desired date, but am running into a problem when I put it into a calendar object and then try to return it:

 

var s_year = data.getValue("institution_name").substring(0,4);

var s_month = data.getValue("institution_name").substring(4,6);

var s_day = data.getValue("institution_name").substring(6,8);

var s_date = new Date(s_month + "/" + s_day + "/" + s_year);

s_date.setDate(s_date.getDate()-5);

 

Calendar s_calendar = Calendar.getInstance();

s_calendar.setTime(s_date);

s_calendar;

 

When try and process this I am getting error:

Error in script execution for attribute: startDate.

blackboard.platform.script.ScriptingException: java.util.concurrent.ExecutionException: javax.script.ScriptException: org.mozilla.javascript.EvaluatorException: missing ; before statement (<Unknown Source>#1)

 

Any suggestions on how I should create and then pass the calendar back to Bb?

 

Thank you,

-Phil

Outcomes