Sidebar Javascript Manipulation of Edit Pages
Written by ShamrockCRM on December 20, 2008 – 9:18 pm -Every once and a while, I just come up with some new, fun way to manipulate Salesforce.com that I have never known was possible.
Previously, you could never put any code on the Edit page of a record for Salesforce.com. Because of this, you could not tie events to certain actions on the edit page, you could not override fields or override lookup windows. You were pretty much limited to editing only the Read page. VisualForce will allow you to work with the Edit page, but it is very limiting once you implement it for the first time.
With this little project, I placed a Sidebar Component on the Home Page Component. This uses an IFrame to link to an S-Control. With this, I constantly detect what page the User is currently on. If they are visiting an Opportunity page, I know this. If they are editing an Account, the code know. With this ability, I can use the code to play with the edit pages.
In this example, I wanted to override the lookup field to take me to another page when the lookup icon is clicked. For my example, I just used Google, but you could use this to take you to a filtered lookup field, which Salesforce does not currently offer. If you want to only show Contacts for a certain Account or something like that, this could do it. It would look just the same as normal. AMAZING!
Also in this example, I implanted a training note onto the page to give the User instructional advice about a certain field. Also useful!
One more thing, I defaulted the lookup field with a certain value. Can you default a lookup field in Salesforce normally? Nope. Possibly useful for aiding in searching.
Exciting and interesting ideas, right?
Related posts:
- Salesforce.com JavaScript to Override Buttons
- Adding Google Calendar to your Salesforce Homepage
- Modifying Salesforce.com Dates Using Javascript
- New Salesforce.com Advanced Search Tool
- Free Salesforce.com S-Control to Dynamically Auto Refresh Dashboards

By Valentino Rijhen on Apr 2, 2009 | Reply
Hi Tanner,
Nice work but…
Where can I find some instructions/examples about your solutions.
I’m trying to add some scripting on a HTML home page component but the script tag is being filtered out!
What am I doing wrong!?!?
Regards,
Valentino Rijhen
By Meghan on Oct 23, 2009 | Reply
Wow – this solves a problem I’ve been dealing with for months – is there any way to take a look at the code?
By Frank on Nov 12, 2009 | Reply
Very interesting. I would love to look at the source code to understand your approach.
Thanks!
By Varun on Jan 7, 2010 | Reply
Interesting Work. Can you show us how you did this
?