I have a callout button attached to an item called 'ProductSort' that is within a replicant. The callout will need to read an item called 'CategoryURL' from the same replicant instance. so, I created a simple regex to change ProductSort to CategoryURL. However, it just doesn't seem to work.
itemName starts out as something like /Category[1]/ProductSort
I would expect the second alert to display /Category[1]/CategoryURL. Howeer, I always end up with ProductSort again. is there something obvious I am missing with my js regex?
function selectSortOrder(itemInst) {
var itemName = itemInst.getName();
var URL = itemName;
window.alert("url:"+URL);
URL.replace(/ProductSort/,"CategoryURL");
window.alert("new url:"+URL);
var URLitem = IWDatacapture.getItem(URL);
URLval = URLitem.getValue();
window.alert(URLval);
}