• Follow us on Twitter
  • Join our Facebook Group
  • Join me on Google Plus
  • Add me on Linkedin
  • RSS
Welcome to the Delivered Innovation blog! close

  • Home
  • Cloud Computing
  • Salesforce
  • DI News & Events
  • Force.com Tips

Tag Archive for: VisualForce

Force Feed 2-20-2012

0 Comments/ in Cloud Architecture / by Delivered Innovation
February 20, 2012

Build Social Applications with the Force.com Toolkit for Facebook
@metadaddy
A third release of Force.com Toolkit for Facebook, now allowing you to write a social application for Facebook in Apex Code and deploy it as Force.com Site, a customer portal, or a VisualForce page running in an org.

Format Salesforce Data Time Fields in Excel
@sfunearthed
Different ways to format Salesforce DateTime fields in Excel.

Multi File Uploader for Salesforce
@TehNrd
Upload multiple files to Salesforce at one time with the first release of Multi File Uploader Tool.

New and Updated Developer Documentation for Spring ’12
@forcedotcom
Developer documentation on developer.salesforce.com and database.com are now updated to reflect the new Spring ’12 Salesforce release.

Monday AM Admin: Get your Chatter-cation
@MikeGerholdt
Get your organization more excited about using Chatter with these insights and suggestions.

Force Feed 12-12-2011

0 Comments/ in Cloud Architecture / by Delivered Innovation
December 12, 2011

The top must-read articles on Force.com and Salesforce from the past week.

Apex Runtime Update for Developer Edition Orgs
@sbob909
Force.com Developer Edition organizations now have a new Apex runtime that compiles directly to Java bytecode.

Force.com MVP Nominations Are Open!
@forcedotcom
The Force.com MVP program is now accepting applications until January 6th. Email your nominations to info[at]developerforce.com.

Visualforce + HTML5 + Mobile
@cloudysan
A few tips on how to use HTML5 and Visualforce for building mobile web applications.

How to Get Ready for a Salesforce User Group Meeting
@mikegerholdt
Tips include make a list of questions, don’t be afraid to speak up, have a mobile device or laptop to take notes on or refer to, bring plenty of business cards, and offer an extra hand at volunteering during the meeting.

Easy Visualforce Charts with Javascript Remoting and Google Charts API
@abhinavguptas
Native visualforce charting is coming soon to Force.com, and Gupta offers an example to render charts using Javascript remoting and Google Charts API.

Create a Custom Web Form Handler With Force.com Sites

0 Comments/ in Force.com Platform Tips / by Michael Topalovich
December 2, 2011

No doubt you’ve run into this also…we needed a form handler that captured data for sObjects other than Cases or Leads (e.g. custom objects), we did not want to redirect visitors to a new page upon form submission, and our functional requirements were more complex than what the standard Salesforce form handlers could support. The standard Salesforce Web-to-Lead and Web-to-Case form handlers were not an option, so we had to create our own custom web form handler. And because we wanted to keep everything on Force.com, we decided to build this solution using VisualForce pages and an Apex controller served by Force.com Sites. We developed an alternative solution and wanted to share it with the community in the event it could help others.

Use case

You want to capture form data directly in Salesforce from either a VisualForce page served Force.com Sites or from an externally hosted page, but the standard Web-to-Lead or Web-to-Case web handlers do not meet your exact requirements. You may also be using custom JavaScript forms that post data using AJAX, and do not want to blindly pass data to a form handler that will not provide a return to indicate success or exceptions.

Ultimately, we wanted to expose our form handler so it could also be accessed by any of our forms on the web (Force.com Sites as well as others such as our WordPress blog, which uses an HTML / PHP-based form to collect data).

So, here’s what we did

To begin, you need to ensure that Force.com Sites is setup correctly if it is not already.  You can find information on creating and maintaining Force.com Sites here or here.  In our case, we created a “utility” Force.com Site so that we could keep the pages separate from our main Force.com Sites web pages.  We also concealed the Force.com Sites utility subdomain in our custom Site.URLRewriter implementation to avoid AJAX cross-domain issues, but that is a discussion for a future post.

You will need to code up a VisualForce Page and an Apex class to serve as a custom controller to capture the form data and cast values to specific fields in the target sObject.  The VisualForce page itself is very simple in its construct…essentially it will serve two purposes:

  1. Perform a specific Action that calls a PageReference method in the custom controller when the page is invoked.
  2. Return a value in a format that the process calling the form handler is expecting.  In our case, our AJAX method is expecting a JSON object with the result of the form submission (success or otherwise).

This is what the VisualForce page for the form handler that we use for www.deliveredinnovation.com looks like:

<apex:page cache="false" controller="formHandlerSample" action="{!processForm}"  showheader="false" contentType="application/jsonrequest" >
 { success: {!success} }
 </apex:page>

The elements of this page to take note of:
  1. The ‘controller’ attribute is the custom Apex class that contains the logic that will process the contents of the web form
  2. The ‘action’ attribute is the PageReference method contained in the Apex class that will process the form data and generate the required return string
  3. Because our AJAX script is looking for a JSON object to be returned, we declared the contentType of ”application/jsonrequest.” You may find that you need to return XML, HTML, or other text, so update this attribute to suit your specific requirements.

The form handler code:

public class formHandlerSample {
public Map<String, String> urlParams;
public String Error {get; set;}
public Lead formLead = new Lead();
   
public formHandlerSample() {
urlParams = ApexPages.currentPage().getParameters();
}
public Boolean Success {
get { 
if(Success == null) { 
Success = false;
}
return Success; 
} 
set;
}
public void processLead(Map<String, String> formFields) {
if(formFields.size() > 0) {
try {
for(String fieldKey : formFields.keySet()){
if(fieldKey != null && fieldKey != 'null'){
if(fieldKey == 'FirstName'){
formLead.FirstName = formFields.get(fieldKey);
}
if(fieldKey == 'LastName'){
formLead.LastName = formFields.get(fieldKey);
}
if(fieldKey == 'Title'){
formLead.Title = formFields.get(fieldKey);
}
if(fieldKey == 'Company'){
formLead.Company = formFields.get(fieldKey);
}
if(fieldKey == 'Phone'){
formLead.Phone = formFields.get(fieldKey);
}
if(fieldKey == 'Email'){
formLead.Email = formFields.get(fieldKey);
}
if(fieldKey == 'Description'){
formLead.Description = formFields.get(fieldKey);
}
}
}
upsert formLead;
Success = true;
}
catch(System.Exception e) {
System.debug('Houston, you have a problem: ' + e);
Success = false;
Error = String.ValueOf(e);
}
}
else {
Success = false;
Error = 'No form fields received';
}
}
public PageReference processForm(){
processLead(urlParams);
return null;
}
}

Questions?  Suggestions?  Leave us a comment or email us directly at Blog [at] DeliveredInnovation.com.


Force Feed 10-31-2011

0 Comments/ in Cloud Architecture / by Delivered Innovation
October 31, 2011

List of all the Salesforce and Force.com posts from the previous week!

#DF11 Recap: Blazing Fast Visualforce
@joshbirk
Josh Birk suggests checking out the DF11 youtube video, Blazing Fast Visualforce Pages to help with your Visualforce understanding/development.

Dynamic Visualforce and Visual Workflow with Rerender
@metadaddy
Patterson walks us through how a Flow embedded in a Visualforce page can interact with other elements on the page in Cloud Flow Designer.

Winter ’12 Release Notes- What’s New for the Week of October 24th
@forcedotcom
Information about new Winter ’12 features such as encrypted fields enabled, changes to granting login access, Chatter REST API enhancements, and more.

Please Don’t Screen Scrape Visualforce
@metadaddy
How to retrieve a Visualforce page from server side code for the purpose of screen scraping it to extract data.

Publishing Real-time Updates from Apex with Pusher
@metadaddy
Trying out Pusher and code for Visualforce page.

Salesforce Oracle Integration: Beyond Closed Won
@dlog
A reliable integration process with Salesforce and Oracle Financials.

Easy Upgrade Eclipse (Helios) Force.com IDE to Winter ’12 Release
@abhinavguptas
Gupta’s preferred way to update in Eclipse Helios.

Merging Salesforce orgs- 5 Tips to Ensure Success
@MikeGerholdt
How to create custom links in Salesforce.

Merging Salesforce Orgs- 5 Tips to Ensure Success
@MikeGerholdt
Tips include know what you’re getting into, consider the data, users, and tools, and visualize the change process for leaders.

Force Feed 10-17-2011

0 Comments/ in Cloud Architecture / by Delivered Innovation
October 17, 2011

A quick roundup of all the Salesforce and Force.com articles from the previous week.

Visualforce RelatedList CRUD FLS Security Tip
@abhinavguptas
Post highlights a common mistake performed by developers in Visualforce.

Visualforce Code Templates/Snippets for Force.com IDE!
@abhinavguptas
Using Force.com IDE with Eclipse.

SQLForce: An Option for Select Distinct in Salesforce
@rdehler
A command for using SQLForce.

Watch and Learn- New Platform & Developer Videos in Winter ’12
@Forcedotcom
Winter ’12 developer videos such as Building a Website with Siteforce, Editing and Managing Content with Siteforce, and Introducing Database.com.

Winter ’12: Efficient, Manageable Security Policies with Permission Sets
@sbob909
Now in Winter ’12, permission sets complement profiles.

Parse JSON by one line of code using Winter ’12 JSON API
@abhinavguptas
JsonParser is a new API addition to Apex Stack. Post explains how to simplify JSON operations using System.JSON API.

Visualforce Charting in Winter ’12
@cloudysan
More about Visualforce Charting, which allows you to develop custom and complex charts using standard Visualforce components.

Winter ’12 Social Approving of Records Using ‘Chatter Approvals’
@abhinavguptas
How Chatter Approvals can be social and fun.

Force Feed 10-3-2011

0 Comments/ in Cloud Architecture / by Delivered Innovation
October 3, 2011

Overview of last week’s Force.com and Salesforce articles.

New Object Reference in Winter ’12 Release
@forcedotcom
Winter 12 release has new Object Reference to help you more easily find information about objects and fields. Preview it through the article.

Using Binary Data with REST
@cloudysan
How to process binary data with Apex REST.

Fixing Connection Issues with Salesforce Servers in Browser & Force.com IDE
@abhinavguptas
When working from various locations, sometimes connecting to Salesforce can be difficult. Try executing this command to flush the DNS cache (at least for Mac OS) to fix the problem.

New Visualforce Features in Winter ’12
@joshbirk
New Visualforce features in Winter 12 such as Visualforce Charting, JavaScript Remoting, and Custom Doctype.

Make Any Salesforce sObject REST-enabled
@jeffdonthemic
A short video outlining how to make any Salesforce sObject REST-enabled.

Winter ’12 Updates to Force.com REST and Streaming APIs
@metadaddy
Key changes in Winter 12 with REST API, JavaScript, and Streaming APIs.

An ERD is Worth a Thousand Words: Schema Builder in Winter ’12
@sbob909
Schema Builder will be officially available in Winter 12, which makes visualizing and documenting Force.com and Database.com schemas easier.

Page 1 of 212

Salesforce CRM, Force.com, Cloud Computing: Application and System Design

Latest Posts

  • Doing Business in the CloudApril 10, 2012, 12:22 pm
  • Delivered Innovation Co-Hosts ITA “State of the Cloud” EventFebruary 22, 2012, 1:30 pm
  • Force Feed 2-20-2012February 20, 2012, 1:21 pm
  • Cloudup 2-17-2012February 17, 2012, 9:45 am
  • State of the Cloud Event RecapFebruary 16, 2012, 4:37 pm

Topics

  • Cloud Architecture (173)
  • Delivered Innovation News & Events (30)
  • Force.com Platform Tips (6)
  • Salesforce Architecture (32)

Follow us on Twitter

Follow @twitter

Latest Tweets

  • Up 38% from a year ago, http://t.co/JEY1hGq5 continues to grow. http://t.co/e7q7MztA
    May 17, 2012 - 3:24 PM
  • RT @Benioff: Congrats salesforce on an amazing quarter. The fastest growing software company of our size! 38%! $3B guide! http://t.co/L ...
    May 17, 2012 - 3:05 PM
  • We have a couple new Apps coming; look forward to giving you a peek soon.
    May 17, 2012 - 12:44 PM
  • Cloud is a corporate strategy, not a tactical solution http://t.co/QltTfDFz
    May 10, 2012 - 7:45 AM
  • Chicago #cloudforce - how fast the day goes... http://t.co/YjRI1vp3
    May 4, 2012 - 9:47 AM

Force.com VAR: Value Added Reseller Partner

Salesforce.com Consultant: Registered Consulting Partner

Salesforce.com ISV: Independent Software Vendor Partner

Tags

#df11 Amazon Apex AppExchange Appirio Chatter cloud Cloud Computing Cloudforce cloud security Coghead Delivered Innovation News Dreamforce ExtJS facebook Force.com Gartner Google heroku IaaS IBM Interop ITA IT service delivery Jonathan Sapir Marc Benioff Michael Topalovich Microsoft Oracle PaaS Platform as a Service public cloud SaaS Salesforce Salesforce.com Sencha SOA Social Media Software as a Service Spring '12 the cloud twitter VisualForce Vmware Winter '12

Salesforce CRM, Force.com, Cloud Computing: Application and System Design


View Larger Map

Delivered Innovation
688 N. Milwaukee Ave #202
Chicago, IL 60642
888.645.2604

Delivered Innovation

  • Delivered Innovation Home
  • DI on AppExchange
  • DI on Facebook
  • DI on Google+
  • DI on LinkedIn
  • DI on Tumblr
  • DI on Twitter
© Copyright - Delivered Innovation Blog - Wordpress Theme by Kriesi.at