Thursday, 20 December 2012

Winter 13 Release Notes

some key notes which will help you to clear maintenance exam.

Permission set Enhancement
Prior to winter 13 permission set can be assigned to user with same user license type,but In winter 13 permission set no longer need to assign license type and can be assigned to user with multiple user license type known as Organization-Wide Permission Set. To create permission set we have to choose User License as None.
You can only specify user license when creating new permission set,you can't change its user license when editing or cloning it


Visual workflow Enhancement
The cloud flow designer let you to create business process visually.
User can navigate from start to finish . In winter 13 we can control the user navigation in the flow. By default user can navigate previous screen of the flow or finish .However you can prevent this by removing previous button and next button in the screen .To do so choose the options “don't show prev button ” in the Navigation options.
In the Add field section there are three new field added in the flow
1-multi select checkbox
2-multi select picklist
3-checkbox
you can display multiple choice by using multi select check box or picklist.check box is used to prompt the user to choose true or false .It can be used in marketing campign.
In winter 13 we can add apex plug in and sub flow which are included in palette in the flow.
Explorer used to easily find resource and element used in the flow.
The Highlight Result on canvas check box help us to easily find search result .when you hover on search icon It will highlight the search element in the flow.
Also there are zoom control and get started link to see the video how flow works and also a link to sample package and apex plugin.

Developer Consol Enhancement
Developer consol is the new tool to create monitor and test the application 'data .
There are some tool newly added
1-Test Tool
2-Query Editor
3-Multiple prospective
Test tool used for testing. Query editor used for soql query execute .
Multiple prospective used displaying same information in different manner . To create prospective click prospective All button in the system log from their choose view panel and save it in a new name.

Enhancement To Apex Test Frame Work
In Winter 13 release salesforce makes test process more rubost by some tool.
We can create csv file and stored as Static resource “testclss.csv” and use the resource in Test.Load data method to declair test data.
For example
List<sObject> tst = Test.loadData(Account.sObjectType , 'Yourresoursename');
It supports for testing both Rest and Soap based callout .
Test.setMock(HttpCalloutMock.class, mock);

Some sample question..
1-which is present in developer-consol..?
2-what is the capacity of visual work flow ?
3-what is the capacity of joined Report ?
4-What can a developer do in apex testing
5-what the Administrator need to do assign a permission set for users with different user license ?
For detail Information refer this pdf

Here is link of video ..Go through this link and watch this video for 15 min then clear exam
.
  

                                                                                     All the Very Best For Exam

                                                                                 
                                                       

Wednesday, 28 November 2012

Salesforce: Custom Picklist in Visualforce Page

Suppose we are going to design a visualforce page and we add a picklist for users on the page. If the field where you want to store the selection is a picklist datatype then there is no problem we can do that by using <apex:selectList>.It is easy because  the field definition will define that ,the page will display a picklist when the Visualforce page is rendered.However, let's say that you want to display a picklist option based on a query from another object.
How would you do that ?.
It can be done by using look up field.we will make two object related by lookup relationship. When your user goes to use the lookup on the page, it opens a new window from which the user can search for records and then select one to populate back to the page.It will take more time to search . I was simply trying to limit the number and type of records that a relationship field made available to the user. I wanted to limit that functionality so that only specific records were permitted in the popup but still enforce the relationship integrity.
In this sample code I am going to make a Visualforce page to allow for editing of Contact records. However, I am going to create picklist options for the Account Name field instead of letting the user  to use Account Name the standard lookup functionality. So let us get into the code.

VisualForce Page
<apex:page StandardController="Contact" extensions="contactExtension"    standardStylesheets="true">

  <apex:sectionHeader title="Contact Edit" subtitle="{!Contact.Name}"    help="/help/doc/user_ed.jsp?loc=help">
   </apex:sectionHeader>
   <apex:form >
    <apex:pageBlock title="Contact Edit" mode="edit">
      <apex:pageBlockButtons >
         <apex:commandButton action="{!save}" value=" Save "></apex:commandButton>
         <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
      </apex:pageBlockButtons>
      <apex:pageBlockSection title="General Information" columns="2">
        <apex:inputField value="{!Contact.FirstName}"></apex:inputField>
        <apex:inputField value="{!Contact.LastName}"></apex:inputField>
        <apex:inputField value="{!Contact.Department}"></apex:inputField>
        <apex:inputField value="{!Contact.Phone}"></apex:inputField>
        <apex:inputField value="{!Contact.Email}"></apex:inputField>
     </apex:pageBlockSection>
     <apex:pageBlockSection columns="1" showHeader="false">
       <apex:pageBlockSectionItem >
          <apex:outputLabel value="Account Name" for="accts"></apex:outputLabel>
          <apex:selectList id="accts" value="{!Contact.AccountId}" size="1" title="Account">
            <apex:selectOptions value="{!accts}"></apex:selectOptions>
          </apex:selectList>
       </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
    </apex:pageBlock>
 </apex:form>
</apex:page>
My Controller:-
public class contactExtension {
    private final Contact c; //User sobject
    
    /*initializes the private member variable u by using the getRecord method from the standard controller*/
    public contactExtension(ApexPages.StandardController stdController) {
        this.c = (Contact)stdController.getRecord();
    }
    
    //builds a picklist of account names based on their account id
    public List<selectOption> getaccts() {
        List<selectOption> options = new List<selectOption>(); 
    //new list for holding all of the picklist options
        options.add(new selectOption('', '- None -')); 
    /*add the first option of '- None -' in case the user doesn't want to select a value or in       case no values are returned from query below*/
        for (Account account : [SELECT Id, Name FROM Account]) {  
   //query for Account records           
         options.add(new selectOption(account.id, account.Name));     
   //for all records found - add them to the picklist options       
      }       
      return options; //return the picklist options    }
}