Posted 11/04/2008 - 12:30 by Karthic Thope
Presto Mashlets can be embedded in Salesforce.com pages using S-Controls. Salesforce.com S-Controls are reusable UI extensions for adding external content and can be embedded anywhere in your Salesforce application. With support for contextual wiring, S-Controls provide an easy way to embed powerful, dynamic and relevant mashups in your Salesforce application.
Create Mashlet in Presto
If you are reading this blog, you probably are familiar with mashlets and know how to create one. If you don't, look at the various MDC tips and articles here on creating a mashlet.
Create Mashlet S-Control
To display Presto mashlets as S-Controls, use Salesforce.com UI to create a new S-Control. Navigate to Setup > App Setup > Develop > S-Controls and click "New Custom S-Control".
- Provide a relevant name and label
- Choose "HTML" as the type
- Supply the mashlet script tag. You can pass contextual parameters to the mashlet invocation using the "Select Field Type" and "Insert Field" dropdowns.
Here is a sample script tag showing contextual wiring of contact's mailing postal code to the mashlet param parameter.
<script src="http://localhost:8080/mashlets?
mashlet=LocalWeatherSimple&width=300px&hideTitlebar=true
¶ms={!Contact.MailingPostalCode}">
</script>
Note: Script tag has been wrapped to improve readability
Insert Mashlet S-Control

Navigate to Setup > App Setup > Customize, select the page you want to embed the mashlet and select "Page Layout" and insert the s-control.
Enjoy the Mashlet!
You are done! The screenshot at the top shows a simple weather mashlet embedded inside the Contacts details tab. The mashlet shows current conditions for a given zipcode and when placed on a page with Contacts information, the contacts mailing postal code is automatically passed to the mashlet and you will see weather for that contact's location. Trivial stuff but you can see power of such integration in the context of enterprise mashups when you can bring information from your internal and external Sales data, ERP systems, online web services, etc. to your Salesforce application.
In summary, S-Controls provide you an easy way to embed Presto Mashlets in your Salesforce.com application.
- Karthic Thope's blog
- Login or register to post comments
- Email this page


