Skip to main content

We are trying to use the E2Excel "Export to Excel" button (downloaded from the App Exchange) on custom objects and it seems to work if you include it directly on the object, but when we try to lauch the button from a 'Related List' we are getting an error message: 

A problem with the OnClick JavaScript for this button or link was encountered: Cannot read property 'value' of undefined

I have very little experience with Java but here is the code they included in the instructions for installation of the botton on the object:

var str = parent.location.href;

var sobjid=str.substring(str.indexOf("?fcf")-3,str.indexOf("?fcf"));

var idArray = {!GETRECORDIDS('selected')};

var listview = document.getElementsByName('fcf')[0];

var listId = listview.value;

var listName = listview.options[listview.selectedIndex].text;

var idString = JSON.stringify(idArray);

window.open('apex/E2Ex__Export_To_Excel?idString='+idString+'&sobjid='+sobjid+'&listid='+listId+'&listName='+listName);

Again, it has worked 'as expected' when added to the Object. But when trying to use it from a 'related list' we get the error message. The buttom appears on the Related List next to the "New" button. Any help you can offer to sort this out, would be greatly appreciated. 
답변 4개
0/9000