Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to set context variable value when the default value is null.
but the code didn't work for me. I'm not sure whats missing in below statements:
if(context.lgc_bus_dt==null){
context.lgc_bus_dt=TalendDate.formatDate("yyyyMM",TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"));};
System.out.println( "Context variable value is:"+context.lgc_bus_dt);it returns Null though even when i'm setting the variable value when its null.
try the following if you are using lgc_bus_dt datatype is string.
if(context.lgc_bus_dt==null || context.lgc_bus_dt.equals("") ){
context.lgc_bus_dt=TalendDate.formatDate("yyyyMM",TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"));}
System.out.println( "Context variable value is:"+context.lgc_bus_dt);
Regards,
try the following if you are using lgc_bus_dt datatype is string.
if(context.lgc_bus_dt==null || context.lgc_bus_dt.equals("") ){
context.lgc_bus_dt=TalendDate.formatDate("yyyyMM",TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM"));}
System.out.println( "Context variable value is:"+context.lgc_bus_dt);
Regards,