Wednesday 15 February 2012

All Standard and Custom objects in a picklist

Hi Friends,

    There is a requirement to retrieve a list of objects in an organization to process them.

Here is the solution:

VisualForce Page to create list of Objects in a picklist:

<apex:page controller="objectList" >
  <apex:form >
    <apex:SelectList value="{!val}" size="1">
      <apex:selectOptions value="{!Name}"></apex:selectOptions>
    </apex:SelectList>
  </apex:form>
</apex:page> 
 
 
Controller for Above code: 

public class objectList{
  public String val {get;set;}
 
  public List<SelectOption> getName()
  {
    List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();     
    List<SelectOption> options = new List<SelectOption>();
    
    for(Schema.SObjectType f : gd)
    {
       options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
    }
    return options;
   }
} 
 
Thanks.... 

DEV-401 Exam Questions with Answers


--> When a record has been rejected by all approvers, Salesforce executes all final rejection actions. Which of the following is NOT a possible final rejection action? Select the Right answer
    a) Lock the record from being edited
    b) Send an email to a designated recipient
    c) Delete the record
    d) Update a field on the record
--> Which of the following cannot be used on a User Page Layout? Please select two (2) choices. Select TWO choices.
    a) Tags
    b) Links
    c) Buttons
    d) Custom Fields
    e) Inline Visualforce
--> An organization wants to leverage a custom objects to track bugs. The organization wants the ability to related bugs to parent bugs in a parent-child relationship. What type of relationship should be used? Select the Right Answer
   a) master-detail
    b) self
    c) hierarchical
    d) many-to-many
--> An organization wants to leverage the import wizards to import different types of data.                 What type of data cannot be imported through the wizard? Select the Right Answer
    a) Accounts and Contacts
    b) Leads
    c) Custom Objects
    d) Users
--> An organization is interested in leveraging the Data Loader to load data into salesforce.com. Which of the following are NOT capabilities of the data loader? Please select two (2) choices. Select TWO Choices
    a) Import greater than 50,000 records
    b) Import data into 2 objects in a single transaction
    c) Rollback import transactions
    d) Run by command line
--> An organization needs the ability view the value of the Opportunity Stage field on an Opportunity Product related list. Please choose the declarative method of fulfilling the requirement. Choose the Right answer
    a) Create an Apex method to replicate the value on the child object, and set the field level security to read-only and expose the new field on the Opportunity Product related list.
    b) Create a cross object formula field on the Opportunity Product object and expose the formula field on the Opportunity Product related list.
    c) Create a validation rule on the Opportunity Product object.
    d) Create a new pick list field called Stage on the Opportunity Product object, and expose the    filed on the Opportunity Product related list.
--> A developer wants to leverage the console to view to see the parent object of the child object in focus on the console. How would a developer specify what related list fields are displayed on the parent object? Choose the Right answer
    a) On an child object’s mini-page layout
    b) On an parent object’s mini-page layout related lists field selection
    c) On the parent object’s page layout related lists field selection
    d) You cannot modify the related fields on the console view
--> An organization has two custom objects to track job positions and salaries for those positions. Everyone in the organization should be able to view the positions however, only select users can view the salary records. What steps should a developer take to ensure the requirement is fulfilled? Choose the Right answer
    a) Create a lookup relationship between positions and salaries; define public access on position and private access on salary
    b) Create a master-detail relationship between positions and salaries; define public access on position and private access on salary.
    c) Create a master-detail relationship between positions and salaries; define private access on position and create sharing rules on salary.
    d) Create a lookup relationship between positions and salaries; define public access on position and public access on salary; create sharing rules on salary to restrict visibility.
--> A developer has created a custom field marked as an external id on an object. If two records in the object have the same external id, and an upsert action occurred for that same external id what would happen. Choose the Right answer
    a) The first matching external id record would be updated
    b) Both matching external id records would be updated
    c) A new record is created
    d) An error would be reported
--> A developer has a requirement to collect the state and the cities for the state selected on account page layout. Once the user selects a state only the possible cities in that state should be available for entry, what is the best declarative method for fulfilling this requirement. Choose the Right answer
    a) Create a workflow rule that will update the city once a state is entered
    b) Create a validation rule which will cause an error if the city is not in the state that has been entered
    c) Create a dependent pick list for cities based on the state that has been entered
    d) Create a formula field that lookups the valid cities for the state entered
--> A developer has created an approval process. What would require that a formula entry criterion be used versus standard criteria? Choose the Right answer
    a) User profile evaluates to ‘System Administrator’
    b) Determine if the record is newly created
    c) Determine if a record has been updated
    d) Determine if a field has been changed             
--> An organization has created a HR application which contains a custom object for job positions and candidates for those positions. The HR managers want to see a view of the position with the best candidates for that position and not just all the candidates listed. What is the best method to fulfill the requirement? Choose the Right answer
    a) Add an inline Visualforce Page on the job position page layout
    b) Add the candidate related list to the job position page layout
    c) Create a validation rule on the job position page layout
    d) Create a formula field on the job position object and add to the page layout
--> Which of the following is not process or data intensive. Choose the Right answer
    a) Time entry application
    b) Inventory management
    c) Word processing
    d) Human resource management
--> Which two (2) items most closely relate to the View layer of the Model View Controller paradigm? Select TWO correct choices
    a) Page Layout
    b) Validation Rule
    c) Custom Tab
    d) Custom Field
--> In which salesforce instances would there be identical record IDs? Choose the Right answer
    a) Production; Full Sandbox
    b) Production; Full Sandbox; Apex Sandbox
    c) Production; Full Sandbox; Config Only Sandbox; Apex Sandbox;
    d) Salesforce.com never repeats record IDs
--> A developer has created a time-based workflow that escalates a Lead record 10 days after it has been created if no updates have occurred. What is the best way for the developer to test that the new time based workflow rule is functioning? Please select two (2) choices.
    a) User Debug Logs setup the Developer; create a new lead record; review debug logs
    b) Create a new lead record; view the time-based workflow queue;
    c) Setup the developer for time-based workflow queue; create a new lead record; view the time-based workflow queue;
    d) Create a new lead record; view the outbound messages queue
--> What settings can you specify on a profile? Please select two (2) choices.
    a) Revoke sharing permissions
    b) Enable record types
    c) Enable create read, create, edit, and delete on objects
    d) Specify language
--> A manager in an organization wants to share specific fields of data to his subordinates that only he has access to. What is the best way to share specific fields of data? Please select two (2) choices. Please select two (2) choices.
    a) Run As on dashboards
    b) Folder Permission on a Report
    c) Run As on scheduled reports
    d) Folder Permission on a Dashboard
--> Under what circumstances would the sharing button to be enabled on a detail view for a record. Choose the Right answer
    a) A developer has added the button to the page layout
    b) When record sharing is enabled in the user profile
    c) When record sharing is set to public read only or private for the object
    d) When record sharing is set to public read/write for the object
--> When creating a sharing rule what entities can data be shared to. Please select three (3) choices. Please select three (3) choices.
    a) Public Groups
    b) Users
    c) Roles
    d) Roles and Subordinates
    e) Queues


 

Search records from object based on name

Hi Friends,

     Now you can search record based on their record names. Just Enter record name and click search button to get records from particular object.Here I am considering Lead Object and searching records from Lead.

*****Visual Force Page********

<apex:page controller="theController">
    <apex:form >
        <apex:pageBlock mode="edit" id="block" title="Search">
            <apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="searchText">Search Text</apex:outputLabel>
                    <apex:panelGroup >
                        <apex:inputText id="searchText" value="{!searchText}"/>
                        <apex:commandButton value="Go" action="{!doSearch}" />
                    </apex:panelGroup>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
                <apex:actionStatus id="status" startText="requesting..."/>
            <apex:pageBlockSection title="Results" id="results" columns="1">
                <apex:pageBlockTable value="{!results}" var="l" rendered="{!NOT(ISNULL(results))}">
                    <apex:column value="{!l.name}"/>
                    <apex:column value="{!l.email}"/>
                    <apex:column value="{!l.phone}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

**********Controller for Above Code********

public class theController {
String searchText;
List<Lead> results;
public String getSearchText() {
      return searchText;
}
public void setSearchText(String s) {
      searchText = s;
}
public List<Lead> getResults() {
      return results;
}
public PageReference doSearch() {
      results = (List<Lead>)[FIND :searchText RETURNING Lead(Name, Email, Phone)][0];
      return null;
}
}
******************************
Please let me know any Issues....

Developer Certification Questions


(1) In Data loader 50,000 more records CRUD at a time
  • True
  • False
(2) ID's are identical in
  • Production, full copy sandbox, developer
  • Production and full copy sandbox only
  • Production , developer
  • None
(3) Maximum No of Master Details per child object
  • 1
  • 2
  • 3
  • 4
(4) For the user object what can you do in the page layout
  • custom link
  • inline vf page
  • custom button
  • custom field
(5) For approval process who can be the submitter
  • profiles
  • roles and subordinates
  • active team members
  • None
(6) In Page Layout can you add inline vf
  • True
  • False
(7) What does out of the box salesforce give you?
  • data warehouse
  • approval process
  • workflow rules
  • validation rules
(8) A developer wants to ensure that when a parent record is deleted, child records are not deleted. Which relationship should the developer choose?
  • lookup
  • master-detail
  • many-to-many
  • master-to-master
  • None
(9) Which statement is true about a custom tab?
  • It can only be included in one application.
  • It can only be included in standard applications
  • It can be included in as many applications as desired.
  • It can only be included in custom applications
(10) When would a developer use upsert and external IDs?(Choose two answers.)
  • To integrate with an external system
  • To migrate customizations from sandbox to production
  • To load related records without knowing Salesforce record IDs
  • To use the Force.com API to query for data
(11) A group of executives has requested a convenient way to see daily metrics without having to log in to Salesforce. How would a developer accomplish this goal?
  • the users’ home page layouts to include a dashboard
  • Create a Workflow rule that sends a link to the dashboard in an email.
  • . Schedule the dashboard for daily refresh and email distribution.
  • Create a series of daily recurring events providing the dashboard link.
(12) A group of executives has requested a convenient way to see daily metrics without having to log in to Salesforce. How would a developer accomplish this goal?
  • the users’ home page layouts to include a dashboard
  • Create a Workflow rule that sends a link to the dashboard in an email.
  • . Schedule the dashboard for daily refresh and email distribution.
  • Create a series of daily recurring events providing the dashboard link
(13) If you want the a list of positions what dashboard would you use
  • metric
  • table
  • chart
  • gauge
(14) Time-dependent workflow will not work with which type of workflow evaluation criteria
  • Only when a Record is created
  • Every time a record is created or edited
  • Every kind of workflow evaluation criteria
  • When a Record is edited and it did not previously meet the rule criteria

(15) Which of the following is a standard Profile?
  • Sales User
  • Marketing User
  • Invoice Manager
  • Contract Manager
(16) What is the maximum number of master-detail relationships that can be created on a custom object? Select the Right answer
  • 1
  • 2
  • 4
  • Unlimited
(17) An organization has decided to manage hiring and positions. A custom object has been created to manage all new job positions. All positions below $50,000 must be approved by the hiring manager, and positions above $50,000 must be approved by the hiring manager, and the regional hiring manager. What would a developer use to declaratively fulfill the requirement? Select the Right Answer
a) Apex Code, to check the position’s salary and assign to the appropriate resource for approval
b) Approval process
c) Validation rules
d) Dynamic Routing Approval
(18) A developer has created a junction object what is the significance of the first master-detail (primary) relationship? Select the Right Answer
a) Look and feel, the junction object's detail and edit pages use the color and any associated icon of the primary master object.
b) You cannot delete the primary relationship.
c) You cannot rename the primary relationship.
d) There is no significance
(19) An organization has created an application manage new hires and job positions. A custom object has been created to manage all job positions. Using an approval process they have configured the application to have the first step of the process require approvals from three different hiring managers. Select the two (2) possible approval choices based on multiple approvers for an approval step. Select TWO Right Answer
a) Approve or reject based on the first response
b) Require unanimous approval from all selected approvers
c) Require majority approval from all selected approvers
d) Require x out of y approval from all selected approvers
(20) Which of the following is NOT a step in creating a junction object? Select the Right Answer
a) Creating the custom object to serve as the junction object between the two master objects
b) Creating two master-detail relationships
c) Customizing the related lists on the page layouts of the two master objects
d) Creating two lookup relationships