cancel
Showing results for 
Search instead for 
Did you mean: 

Setting variable to current date in On Variable Initialization

eddy_declercq
Active Contributor
0 Kudos

Hi,

I need to set a variable to the current date in the On Variable Initialization,but APPLICATION.getInfo() doesn't seem to be allowed.

Are there any alternatives?

Eddy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can do one thing Set Variable for any dummy value in "On Variable Initialization".

Then in "On Startup" use

APPLICATION.getInfo().dateNowInternalFormat;

& Substring to get required Date format

Convert.subString(Date,0,4)

& load your data source(s) after that.

Former Member
0 Kudos

Hi,

Why not use "On Startup" and set the variable value using APPLICATION.setVariableValue() after reading the current date using APPLICATION.getInfo()

Regards,


eddy_declercq
Active Contributor
0 Kudos

Since I need set the deafult value for my prompt in On Variable Initialization

Former Member
0 Kudos

Hi,

In such case, in my view, it would be better to have this default value set from BW itself.

In anycase the current date you get in Design Studio need to be converted to BW variable input format. Doing this in DS is quite tedious as you don't have many methods to manipulate the return string/date.

Regards,