Posts

Showing posts from April, 2012

S-Controls in Salesforce

Image
Use s-controls to add your own functionality to your Salesforce organization. Whether you are integrating a hosted application of your own or are extending your current Salesforce user interface, use s-controls to store your code or refer to code elsewhere. Custom s-controls can contain any type of content that you can display in a browser, for example a Java applet, an Active-X control, an Excel file, or a custom HTML Web form. Here're the steps to create a new S- Control The custom s-control library is a place where you can store and upload content for use in many areas within Salesforce such as, custom links, Web tabs, custom buttons, and dashboards. From Setup, enter S-Controls in the Quick Find box, then select S-Controls. To create a new custom s-control, click New Custom S-Control. To change an existing custom s-control, click Edit. Enter s-control attributes. To validate all Salesforce merge fields and functions, click Check Syntax. Click Save when you finish or click Quick...

Display error messages with different severity levels in a Visualforce page

Image
To display error messages with different severity levels in a Visualforce page using ApexPages.addMessage, you can follow the same approach as before but with different severity levels. Here's how you can add messages with different severity levels and display them in a Visualforce page: Add Messages with Different Severities in Apex Controller: In your Apex controller, add error messages with different severity levels using ApexPages.addMessage. public class MyController {     public void someAction() {         try {             // Perform some action             if (someCondition) {                 // Add error message with severity                 ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'An error occurred: Some error message'));             } else if (another...