Timeline for Why does this Javascript code not work?
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 12, 2015 at 22:43 | answer | added | dsharrison | timeline score: 1 | |
Dec 20, 2012 at 17:36 | comment | added | Rao | @techtrekker can you please post it as an answer !!! It was a freaking magical solution that could help many people !!! | |
Dec 20, 2012 at 9:59 | comment | added | techtrekker | This should sort you out , probably beat using a Jquery selector with document.ready(), which I tend to rely more on than window.onload tehnrd.com/show-and-hide-buttons-on-page-layouts | |
Dec 20, 2012 at 8:09 | comment | added | Tanuj Kumar Sharma | Try replacing single quotes with double quotes for ids. Something like this - var eles = document.getElementsByName("edit"); for(var i=0;i<eles.length;i++){ eles[i].style.display = "none"; } | |
Dec 20, 2012 at 4:45 | history | tweeted | twitter.com/#!/StackSalesforce/status/281621333551480832 | ||
Dec 20, 2012 at 3:13 | comment | added | Rao | daniel let me find out if its ok to lock record. sounds nice to do it tht simple, | |
Dec 20, 2012 at 3:12 | comment | added | Rao | Peter i am getting no errors too, but the problem is te code is not entering document.getelementbyname('edit') !!! am i doing something wrng r is there a better way to hide button. | |
Dec 20, 2012 at 2:52 | comment | added | Daniel Hoechst | If you want don't want to have users editing a record when a field is a specific value, you could look at locking the record. Here's one way to do that: verticalcode.wordpress.com/2012/07/26/…. | |
Dec 20, 2012 at 1:58 | comment | added | Peter Knolle | I can execute that JavaScript directly from the Chrome Conosle w/o error on the Account detail page that has an edit button, so not sure exactly what's going on. I'ts probably not a good idea to override the window.onload function. You should be able to use JS to append to it, e.g., multiple onload handlers or use jQuery to abstract that level of detail out. Without your code in place, you can execute window.onload from the Chrome Console and see that SF has something defined already. | |
S Dec 20, 2012 at 1:28 | history | suggested | Ryan Guest | CC BY-SA 3.0 |
Not JScript (Micrsoft's javascript dialect), but Javascript
|
Dec 20, 2012 at 1:20 | comment | added | Rao | yes i want to hide the button based on a field value!!! so this is the first part where i want to just hide the button and start putting conditions later | |
Dec 20, 2012 at 1:17 | review | Suggested edits | |||
S Dec 20, 2012 at 1:28 | |||||
Dec 20, 2012 at 1:10 | comment | added | Matt Lacey♦ | Is there a reason you're not just removing the edit button from the page layout? | |
Dec 20, 2012 at 0:44 | history | edited | Rao | CC BY-SA 3.0 |
added 44 characters in body
|
Dec 20, 2012 at 0:38 | history | asked | Rao | CC BY-SA 3.0 |