How to display a text on parameter hierarchy filter when token is selected to All.

I have a scenario to refresh the parameter hierarchy filter on the button click. Using this script I achieved the result. parameter value updated and applied on the chart.
var view = dundas.context.baseViewViewService.currentView
var myToken = new dundas.data.ParameterToken({
“caption”: “All”,
“id”: dundas.constants.ALL_TOKEN_DEFINITION_ID
});
var vp = view.control.getViewParameterByName(‘vp’)
vp.parameterValue.token = myToken;
vp.invalidateParameterValueLastModifiedTime()
vp.refreshAllAdapters()

The issue is I can’t see value “All” on the parameter hierarchy filter. after execution, it displayed the previous value which is an issue. Are there any ways to set the text “All” when this script will execute.
image

Before assigning a value or token, you need to clear the previous values assigned to the view parameter.

In your case,

vp.parameterValue.clearValues();
vp.parameterValue.clearTokens();

Hi Renzi,
Thanks for response. Actually I did this. Unfortunately this didn’t work. Do you have any other idea how to set text to “All”.

Could you paste here the code that you’ve used?

There is a documentation on the dundas site regarding your issue. https://www.dundas.com/support/support-center/support-articles/scripting/modify-a-filter-/-view-parameter-using-scripting