Hi Matt,
if I understood right, you're searching something like this below.
Hope, this helps.
Kind regards,
Thom
// FYI: Put as required all the code including the set/get functions into the Dashboard.Ready() event, a Filter.ParameterValueChanged() event, or into a Button.Click() event etc.
// Set Customer________________________________
setCookie("currentCustomer", "Darth Vader", 2);
// Alternative: Set Customer based on the a filter selection
// setCookie("currentCustomer", parameterHier1.control.parameterValue.values[0].uniqueName, 2);
// If you want to get a Customer Name and assign it to a hierarchy control___________________
/*
var chCustomer = getCookie("currentCustomer");
var myParameter1 = this.control.viewParameters.filter(function(item) {
return item.name === "viewParameter1";
})[0];
var filterValue1 = new dundas.data.MemberValue({
hierarchyUniqueName: "CustomerID",
levelUniqueName: "A.CustomerID",
// !! Check, if the (security) attribute "A." is set/defined right !!!
uniqueName: chCustomer
});
myParameter1.parameterValue.token = null;
myParameter1.parameterValue.values.length = 0;
myParameter1.parameterValue.values.push(filterValue1);
myParameter1.invalidateParameterValueLastModifiedTime();
myParameter1.refreshAllAdapters();
*/
// Cookie Settting Function Definitions _____________________________________________________
// Of course, instead of the event these could (should?:)) be separately defined in a library
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
};
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length,c.length);
}
}
return "";
}