You need to sign in to do that
Don't have an account?
David S
JavaScript issue in home page component
Hello,
I'm new to javascript. I'm having trouble with the following code in a home page component. The purpose is to disable the "All Users" list view on the Calendar page:
While the script does work, the problem is that it interferes with other standard layout pages in Salesforce, such as the related lists on a page layout stop working. Is there anything i can do to stop this behavior. I understand there is the noConflict function available, but no sure how i would use it in this case.
Thanks in advance,
David
I'm new to javascript. I'm having trouble with the following code in a home page component. The purpose is to disable the "All Users" list view on the Calendar page:
<script> function hideButton() { var saveandNewid = document.getElementsByName('fcf'); var saveNewlen = saveandNewid.length; for( var i=0; i< saveNewlen; i++) saveandNewid[i].options[0].disabled=true; } window.onload = hideButton; </script>
While the script does work, the problem is that it interferes with other standard layout pages in Salesforce, such as the related lists on a page layout stop working. Is there anything i can do to stop this behavior. I understand there is the noConflict function available, but no sure how i would use it in this case.
Thanks in advance,
David
You need to uniquely identify the element you are trying to disable. Either check for an identifying attribute in your for loop, or use a more specific selector. Are you trying to disable the 'Multi User View' link?
In my org that link has style class 'multiUserViewIcon', so I'd probably use jQuery like this:
FYI, noConflict is for preventing collisions between javascript libraries, so you are correct that it won't help in this case.
Actually, I don't want to prevent the users from going into the multi user view. But once they are there I don't want them to select the "All Users" option in the list view. Is it possible to just disable that option?