Yes the ‘allow unset fields’ checkbox is checked.
Current incantation of code looks like (see Below)
Previous incantation of code I would not assign anything to the out.LOTEXPDATE if the string date field in was blank and the next operation errored out…
customStep_ConvertJDEDatestoMSSQL_method$out out = new customStep_ConvertJDEDatestoMSSQL_method$out();
/* begin custom code */
out.$LOTEXPDATE = true;
out.$PROMDELDATE = true;
out.$RECEIPTDATE = true;
out.$DATETIME = true;
out.$PROCESSTIME = true;
out.LOTEXPDATE = DDDDYYYYTimetoBrokerDate( LOTEXPDATE, “” );
out.PROMDELDATE = DDDDYYYYTimetoBrokerDate( PROMDELDATE, “” );
out.RECEIPTDATE = DDDDYYYYTimetoBrokerDate( RECEIPTDATE, “” );
/* end custom code */
return out;
}
public static class customStep_ConvertJDEDatestoMSSQL_method$in {
public String LOTEXPDATE;
public boolean $LOTEXPDATE;
public String PROMDELDATE;
public boolean $PROMDELDATE;
public String RECEIPTDATE;
public boolean $RECEIPTDATE;
public String DATETIME;
public boolean $DATETIME;
public String PROCESSTIME;
public boolean $PROCESSTIME;
}
public static class customStep_ConvertJDEDatestoMSSQL_method$out {
public BrokerDate LOTEXPDATE;
public boolean $LOTEXPDATE;
public BrokerDate PROMDELDATE;
public boolean $PROMDELDATE;
public BrokerDate RECEIPTDATE;
public boolean $RECEIPTDATE;
public BrokerDate DATETIME;
public boolean $DATETIME;
public BrokerDate PROCESSTIME;
public boolean $PROCESSTIME;
}
/* begin custom code */
public static BrokerDate DDDDYYYYTimetoBrokerDate(String dateIn, String timeIn ){
// Assumption made that dateIn is in the following format DDD/YYYY
// Assumption made that timeIn is in the following format HH:MI:SS
// Set up objects one time.
BrokerDate brokerDateObject = new BrokerDate();
Calendar calendarObject = new GregorianCalendar();
Date dateObject = new Date();
try {
if ( dateIn.length() > 4 ) { // We think we have a date
// clear calendar values
calendarObject.clear();
// set calendar year
calendarObject.set(Calendar.YEAR, Integer.parseInt(dateIn.substring( 4, dateIn.length() ) ) );
// set calendar day of year to input julian day of year
calendarObject.set(Calendar.DAY_OF_YEAR, Integer.parseInt(dateIn.substring( 0, 3 ) ) );
// set time objects
if ( timeIn.length() > 7 ) { // We think we have a time
try {
calendarObject.clear(Calendar.HOUR);
calendarObject.clear(Calendar.MINUTE);
calendarObject.clear(Calendar.SECOND);
//System.out.println("Hour=" + timeIn.substring( 0, 2 ) + "\n" );
//System.out.println("Minute=" + timeIn.substring( 3, 5 ) + "\n" );
//System.out.println("Second=" + timeIn.substring( 6, 8 ) + "\n" );
// set calander hour
calendarObject.set(Calendar.HOUR, Integer.parseInt(timeIn.substring( 0, 2 ) ) );
// set calancer minutes
calendarObject.set(Calendar.MINUTE, Integer.parseInt(timeIn.substring( 3, 5 ) ) );