Skip to main content
The way to achieve your own success is the willingness to help somebody else. Go for it!
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set current selections by date

Hi guys,

I am not able to filter in my mashup by date through javascript. I've tried several solutions

app.field ("YYYYMM"). selectValues (["2011-01"], true, true);

app.field("YYYYMM").selectValues(["40544"],true, true);

app.field("YYYYMM").selectValues(["2012-May"],true, true);

app.field("YYYYMM.autoCalendar.YearMonth").selectValues(["2012-May"], true, true); 

app.field("YYYYMM.autoCalendar.YearMonth").selectValues(["40544"],true, true);

app.field("YYYYMM.autoCalendar.YearMonth").selectValues(["2011-01"],true, true);

app.field("=Dual(Year([YYYYMM])&'-'&Month([YYYYMM]),MonthStart([YYYYMM]))").selectValues(["2012-May"], true, true);

app.field("=Dual(Year([YYYYMM])&'-'&Month([YYYYMM]),MonthStart([YYYYMM]))").selectValues(["40544"], true, true);

app.field("=Dual(Year([YYYYMM])&'-'&Month([YYYYMM]),MonthStart([YYYYMM]))").selectValues(["2011-01"], true, true);

Manually in chart working very well:



Log CurrentSelectionsList:


2 Replies
Specialist II
Specialist II

Working with this myself and I found selecting date as a number seems to work. (remove the quotes):

      app.field("YYYYMM.autoCalendar.YearMonth").selectValues([40544],true, true);


According to the help site: "Dual() combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes." Therefore it is limited on selecting the text representation of the DUAL field.

Instead of using selectValues() and selecting on the numeric values of the field like David said, you could use selectMatch() method, and provide the text values you want to selected in a seach syntaxt.

e.g. app.field('DayOfWeek').selectMatch('(Monday|Tuesday|Wednesday)', true);

You can also use toggleSelect() method for toggling your selection.

Please mark this answer to be helpful and close the thread if it works for you.