Entries in visualforce pages (2)


Explore Different Messaging Options in VisualForce (Part 1)

VisualForce offers several options when it comes messages such as a warning of an error. Today, I'm going to explain the key differences between the messaging options in VisualForce:

  • apex: pageMessage is used to display a single custom message using the Salesforce formatting. With this one, you have the option to control and specify the "Severity" (the displaying of the message box) and the "Strength" (size of the box). Check out the below code for an example:

    <apex:pageMessage summary="This is a pageMessage" severity="error" strength="1"/>
  • Another option is to use apex: pageMessages; which is used to concurrently display the custom messages entered by the developer and those generated by Salesforce. See the example in the code below and how it renders:
 <apex:page controller= "TestMessageController">
  <apex:pageMessages />
public class TestMessageController{
    public TestMessageController(){
         ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'This is apex:pageMessages'));
         ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'This is apex:pageMessages still'));
         ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'This is apex:pageMessages info'));
         ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'This is apex:pageMessages warning'));

Salesforce S-Controls

Recently, a client was asking me about S-Controls in Salesforce.  He’d been to a user’s group meeting and heard the term tossed around, but had no idea what it meant.  I explained to him what S-Controls are, and informed him that they are now, fairly recently, somewhat antiquated.  But given that they are still widely in use in a lot of Salesforce orgs, I suppose it makes sense to define them here.

S-Controls allow Salesforce developers to leverage HTML and Javascript to create custom pages and UI components.  These customizations are used when an admin needs to work with a small set of records or fields, or if he or she needs to link to an external server.

S-Controls enable developers to add their own functionality to a Salesforce org.  Among some of the possibilities, you can integrate hosted apps, or extend the Salesforce UI. 

Custom S-Controls can contain any type f content that can be displayed in a browser, whether it be a Java applet, an Active-X control, or an HTML web registration form.  The custom S-Control library is where you store and upload the content that you want to use within your org.

S-Controls have essentially been replaced by Visualforce pages.  If you currently have S-Controls in place, they will remain active and can be modified.  But any org that has not created an S-Control before March 2010 or any new orgs will be prevented from using S-Controls in favor of Visualforce pages.