You need to sign in to do that
Don't have an account?

Modify content on standard new/edit page for accounts
Hi,
I tried googling around, but I couldn't really find what I am looking for. What are currently the options of changing the behaviour and content of standard (new/edit) pages? See below for the scenario I would like to create.
I would like to create address lookup based on postcode details. For this I would like to modify existing pages for accounts.So I created a sidebar component and added some javasript to modify the components. Unfortunately, when deploying to sandbox I found out that it will not work, because different server addresses for the visual force servers
[code]
window.parent.document.getElementById('acc17country')
[/code]
Since the account has a lot of fields I don't really like to go into the way of full recreate the new/edit pages with a new visual force page.
So I am looking for ways to modify the content, I know there are some things possible like adding a (floatable) picklist for the countries in this app CountryCompleteFree. But I cannot really understand how they are doing this. Any help will be appreciated.
I think you'll find this is done using an HTML area sidebar component that executes some javascript from a static resource file - that's how other address lookups I've seen worked.
All Answers
I think you'll find this is done using an HTML area sidebar component that executes some javascript from a static resource file - that's how other address lookups I've seen worked.
Bob thanks a lot, you made me think again and I have solved the problem now. It makes me so happy, and that before the weekend :) Below a part of my solution, but I feel that the use of component and HTML/javascript in there feels a bit like a hack. I wonder how long Salesforce still allows this functionality.
For everybody who's interested. Here is what I did to transfer the standard country field into a picklist rather than a text field on standard account page. Next step for me is adding input fields so I can build postcode lookup :)
1) Enable the following setting: Go to Setup -> Customize -> User Interface -> Show Custom Sidebar Components on All Pages
2) Create a new home page component and add it to the narrow home page layout.
3) Upload the static resource with the javasript which can modify the page
ps: thanks to Harm Korten which supplies most of this code http://salesforce.harmkorten.nl/2010/salesforce-country-fields-as-picklists/
i have added a custom javascript component to home page side bar. But if i add this then i cant hide the side bar if open or open if its closed. And even my inline editing properrty is also not working? have you seen any thing like this before?
This is great, thank you for posting this!
Thanks schreurs_id, Your post helped me a lot.
HI did it not break your inline editing fucntionality.?
Hi Bob,
My requirement is to hide the standard account field from record detail page. So taking help from this post, I created a visualforce page and embedded it in the account record detail page.
To hide the standard Billing address field from account object, I tried the below code
<apex:page standardController="Account">
<script src="/js/dojo/0.4.1/dojo.js"></script>
<script src="/soap/ajax/11.1/connection.js" type="text/javascript"></script>
<script type="text/javascript">
dojo.require("dojo.collections.Store");
dojo.require("dojo.charting.Chart");
dojo.require('dojo.json');
alert('test1');
if(document.getElementById('acc17_ilecell') != null) {
alert('test2');
var select = document.getElementById('acc17_ilecell');
var curValue = select.value;
alert('curValue '+curValue );
var parentx = select.parentNode;
parentx.removeChild(select);
select = document.createElement('select');
select.size = 1;
select.id = 'acc17_ilecell';
// select.name = 'acc17_ilecell';
parentx.appendChild(select);
alert('test');
}
</script>
</apex:page>
However, the control is failed to enter inside if block. I am not sure why. Please help.
Thanks,
Pragati