You need to sign in to do that
Don't have an account?
jrotenstein
S-Controls and AJAX: Showing a pull-down list of related contacts
I had a bit of fun building an S-Control using AJAX that shows Contacts with similar email addresses.
I've posted the code on the wiki if anyone is interested. Feedback/suggestions welcome.
John Rotenstein
Sydney, Australia
I've posted the code on the wiki if anyone is interested. Feedback/suggestions welcome.
John Rotenstein
Sydney, Australia
The 'Show All' option doesn't seem to show in mine though... Could using Safari affect that?
Either way, thanks for the inspiration.
//Johan
I've inserted a missing line at the end, so it works now.
Thanks to JohanLiljegren!
Thanks for the quick update.
//Johan
Hello John,
Great example code. You have really opened my eyes to some ideas that will bring greater functionality to my users. Thanks for posting it.
One question / idea: I would like to use this mini tool to help my sales reps see leads and contacts that have the same domain name but exclude the most common email domain names like gmail.com, yahoo.com, btinternet.com, hotmail.com etc . . . By doing this the mini tool would become more effective in helping reps seeing related leads or contacts within in companies like greenworks.com, hatchertech.com, toldosperez.es, etc . . .
Since we do not market directly to businesses and only market to leads that find our site this would help know form the very beginning that others in the same business are intersted in our products. This could prove very helpful in our B2C business although it would be even more helpful in a B2B business.
Could another scontrol snippet or admin field somewhere in SF be used to create a list of omitted email domian names? This would be called upon each time the code is loaded and would prevent our SF from showing 10,231 gmail.com emails lol!
How could I program the call out to the list of omitted domain names?
Thanks again!!
crmzepher
Here's a revised version of the code.
You'll need to create a new Custom Object called "Unwanted Domain". The create a record for each domain you want to exclude, with the domain stored in the Name field.
I just added one lookup, but also put the whole routine into a function so that I could exit if an Unwanted Domain is found.
I am not a developer but thought your drop down idea was a good one. Unfortunately am having problems loading it up, and wondered whether there was a step I am missing? The drop down box appears but there is no data populating it? I am using safari on mac
I copied the code went to DEVELOP set up a new HTML S COntrol and pasted code in. gave it the related_list name and then saved, in CONTACTS page set up added to a field section and saved...
Any elp you can provide wld be helpful....
//Johan
In the <body> tag of the S-control/html, it looks nice to put SFDC's background color in:
<body bgcolor=#f3f3ec>
Hi John,
I am also encountering the same issue as Mikecredent although I have IE 7.0. There are related contacts with the same domain in the system, however the picklist pulldown contains no data. Any ideas?
Thanks for your help.
I have tested the code in IE7 on Windows (plus Safari and Firefox on Macintosh) and it works fine for me.
Installation
Here's the steps I took:
- Created new S-Control
- Pasted the code directly from the wiki page
- Save
- Went to the Contact Page Layout
- Dragged the new S-Control onto the layout
- Double-clicked, set height to 22 and ticked "Show label"
- Went to a Contact that shared an e-mail address with another Contact (eg fred@gmail.com and jim@gmail.com)
- The pull-down menu appeared
So, if that's what you did and it isn't working for you, it'll need some debugging.User Profile
Here's one thing to check if you're not logged in as an Administrator:
- Take a look at the User record of the login you're using to test the control
- See what Profile that user has
- Check the Profile and make sure that API Enabled it turned ON
The S-Control uses the API to call-back to Salesforce, so the user's profile requires this permission.Browser
Another thing you can do is check if there are any errors being generated within the browser (look at the bottom-left of the window).
And finally... you could always switch to Firefox! :)
:smileyvery-happy: Outstanding! Thank you so much. It looks to be that my original HTML code was outdated/flawed, but when I recopied the code from the WIki, all works well in both Internet Explorer AND Mozilla.
This s-control will greatly improve processes since a count of similar domain "siblings" are now flagged directly in front of account managers.
Fantastic code, I can't say enough!