top of page

Custom Reset Selections Button in MicroStrategy

Updated: Jul 9, 2020

These last two months has been extremely busy. Someone recently asked me about creating a "reset selections" button using Javascript.


There are many MicroStrategy functions we can code into a custom Javascript button. I've previously posted on some of these so I'll use the same explanation below with the custom code to reset selections in a document.

There are 3 things we need to make this happen

1. The export function(s) we want to use

2. A listener

3. A button to trigger the function


These are all relatively easy to add in an html container within MicroStrategy. To begin add an html container to your document and make sure the Html Container is set to "HTML Text" in the properties.

add the snippet of code below;

<script>

function rs() {

mstrApp.docModel.controller.resetSelections();

}

document.getElementById("button").addEventListener("click",rs);

</script>

<input id="button" value="rs" type="button"></p>

</form>

This is great! Now I can create custom buttons directly from within the dashboard to trigger functions.


Bonus: we can format/style the button however is needed to meet the requirements from within the HTML container. I typically like to set the button to transparent (with no text) overlay it on a custom image of my choice to give the user an even better over all experience! See this post to format this button the easy way.

 

Thanks for checking out this blog post. If you found this post helpful please consider donating via PayPal. Any contribution is appreciated!


1,901 views1 comment

Recent Posts

See All
bottom of page