Search
Twitter

Entries in sales force tutorials (2)

Wednesday
Nov062013

Salesforce Page Layout

In SalesforcePage Layouts allow for customization of UI pages for users in your organization. And often times throughout Salesforce.com, you have pages of objects that might contain items that are not used by many users. Today, I'm going to explain how you can customize a Salesforce page layout with the fields, related lists, and custom links that suit your organization's use.

In the example below, I'll change the layout of the page Contracts. Note that you can "Edit" the current page layout of that object, but it's best to create a new Contract Page Layout and then assign it the default one.

  • To get started, go to Your NameSetupCustomizeContractPage Layout> Click on New.

     
  • Fill in the appropriate information and click "Save".

  • Next, drag and drop the fields, buttons, and related lists you want on the Contract Page Layout.

  • Then, click "Save".

Assigning Page Layouts

Now that you've created the page layout, you can assign it to the appropriate user Profiles in your Salesforce org.

  • Go back to the "Contract Page Layout" and click "Page Layout Assignment".

  • Pick the profile and assign the appropriate Page Layout. Then, click "Save".

Wednesday
May012013

Explore the Different Messaging Options in VisualForce (Part 2)

This post begins where Part 1 left off; continuing to explore the different messaging options in VisualForce.

  • apex:message allows for field-specific errors. Let's look the code below and see how it renders:
<apex:page controller="TestMessageController">
    <apex:form >
        <apex:outputLabel value="Test String" /><apex:inputField value="{!test.Name}" id="test"/>
        <br/><apex:message for="test"/>
    </apex:page>
 
public class TestMessageController{
    public Account test {get;set;}
    public TestMessageController(){
        test = new Account();
        test.Id.addError('Correct');
        test.Name.addError('Wrong');
 
    }
}
  • The last option we have is apex:messages, which is similar to apex:message, except that it displays all errors in a list. Let's incorporate the apex:messages in the previous code and see how it renders:
<apex:page controller="TestMessageController">
    <apex:messages />
    <apex:form >
      <apex:outputLabel value="Test String" /><apex:inputField value="{!test.Name}" id="test"/>
      <br/><apex:message for="test"/>
    </apex:form>
</apex:page>
 
public class TestMessageController{
    public Account test{get;set;}
    public TestMessageController(){
        test = new Account();
        test.Id.addError('Correct');
        test.Name.addError('Wrong');
    }
}