cancel
Showing results for 
Search instead for 
Did you mean: 

Application.setVariableValue

john_coudriet
Participant
0 Kudos

I am trying to use the application.setvariableValue in the onselect event for a date field. After the date is entered, the query should execute and the values in the crosstab should change. However the data is not changing.

the following is the code in the onselect event:

datefilter = DATEFIELD_1.getDate();

APPLICATION.setVariableValue("0P_KEYDT",datefilter);


is there a step I am missing.  I am executing locally.

thanks for the help.

Accepted Solutions (1)

Accepted Solutions (1)

murali_balreddy2
Active Participant
0 Kudos

Make sure you pass the date in the correct format of the variable and internal or external type. Date from the DATEFIELD component is of the format YYYYMMDD. It should work fine.

Here is an example: In my case I use CALMONTH variable and the script used is

var varMonth = Convert.subString(DATEFIELD_1.getDate(), 4,6) + "." + Convert.subString(DATEFIELD_1.getDate(), 0,4);

APPLICATION.setVariableValueExt("VAR_CALMONTH_USER", varMonth);

Thanks.

john_coudriet
Participant
0 Kudos

Murali

thanks - when I used the external format it worked. Also I had blank lines in my script which appear to cause the script not to execute.

murali_balreddy2
Active Participant
0 Kudos

Glad it worked for you. Blank lines and comments should not cause any script failures.

Answers (0)