Salesforce

An effort to bring a revolution in Salesforce.

Friday, 25 September 2015

Recursive trigger & class in salesforce

 

Recursive trigger & class  



public Class checkRecursive{
      private static boolean check = true;
      public static boolean checkOneTime(){
             if(check){
                    check = false;
                    return true;
             }
             else{
                    return check;
             }
      }
}


 Trigger for update Account from Contact 


Description : i have to create one check Box field called Is_Main__c in contact if it will checked then it's Name  copy to Account's  field called Account Site  and update Account and also uncheck  other related contact list's  filed called Is_Main__c .  only one contact par Account have checked that field  and update contact.


trigger test on Contact (after update) {
    List<Contact> cont = new List<Contact>();
    Contact con = Trigger.new[0];
    Contact conOld;
    Account acc = new Account();
     if(Trigger.isUpdate && checkRecursive.checkOneTime()){
      conOld = Trigger.old[0];
           if(con.Is_Main__c != false){
           
                acc = [select id,Site from Account where id =:con.AccountId];
                acc.site= con.FirstName +' '+ con.LastName;
                update acc;
            }
           
            cont = [select id,Name,accountId,Is_Main__c from Contact where accountid = :acc.id];
            for(Contact c :cont){
              
                if(c.Is_Main__c != False && c.Id != con.Id)
                   c.Is_Main__c = False;
                  
            }

            update cont;
           
            List<Contact> contactCount = new List<Contact>();
            contactCount = [select id,Name,accountId,Is_Main__c from Contact where accountid = : con.AccountId and Is_Main__c = true];
         
            if(conOld.Is_Main__c == true && con.Is_Main__c == false){
                con.addError('There must be at least one main contact with account.');
            } 
      }
   
   }
,

Salesforce !! which record is read-only trigger?

Which record is read-only trigger Salesforce.

"execution of AfterUpdate caused by: System.FinalException: Record is read-only


This kind of error occurs if you try to update lists/record which are/is read only in the trigger execution. For example, trigger.new and trigger.old are both read only lists and cannot be applied with a DML operation.

Say if you write Update trigger.new; in your trigger you will get the above mentioned error.
A field value of object can be changed using trigger.new but only in case of before triggers. But in case of after triggers changing the values of the records in trigger.new context will throw exception as "Record is read only"

Examples:

trigger mytrigger on account(before insert,before update){
  for(account ac:trigger.new){
      ac.name ='abc';
  }
}

Above code will update the names of the records present in trigger.new list. But, the below code will throw run time exception "Record is read only".

trigger mytrigger on account(after insert,after update){
  for(account ac:trigger.new){
      ac.name ='abc';
  }
}

Also trigger.old will always be read only no matter where you use it either before trigger or after trigger.
That is both the below codes will throw run time exception as trigger.old is read only

trigger mytrigger on account(after insert,after update){
  for(account ac:trigger.old){
      ac.name ='abc';
  }
}
trigger mytrigger on account(before insert,before update){
  for(account ac:trigger.old){
      ac.name ='abc';
  }
}

Notes:
1. Trigger.new and trigger.old are read only
2. An object can change its own field values only in before trigger: trigger.new
3. In all cases other than mentioned in point 2; fields values cannot be changed in trigger.new and would cause run time exception "record is read only"
,

Salesforce trigger for Convert Lead Owner Queue to Logged in User !!

Salesforce trigger  for Convert Lead Owner Queue to Logged in User


trigger leadConvertToLoggedInUser on Lead (before update) {
   User u = [select Id, Name from User where Id =: UserInfo.getUserId()];

   for(Lead Ld : Trigger.New){  
           String leadOwner = Ld.OwnerId;
           if(leadOwner.startsWith('00G')){
               Ld.OwnerId = u.Id;
           }
   }

}
,

Sunday, 23 August 2015

How to Set Dynamically Heder|footer in Visualforce page rander as Pdf

 Rander As Pdf Header / Footer  Visualforce  || Saleforce


<apex:page renderAs="pdf" applyBodyTag="false" standardController="Account">
<head>
    <style type="text/css" media="print">
        @page {
            @top-center {
                content: element(header);
            }
            @bottom-left {
            content: element(footer);
            }
           }
           div.header {
           padding: 10px;
           position: running(header);
           }
           div.footer {
           display: block;
           padding: 5px;
           position: running(footer);
           }
           .pagenumber:before {
           content: counter(page);
           }
           .pagecount:before {
           content: counter(pages);
           }
    </style>
</head>
           <div class="header">
              <div>Account name is: {!Account.name} }</div>
           </div>
           <div class="footer">
                <div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>
          </div>
          <div class="content">
               <p>Put all the Page content in this Div Tag  </p>
          </div>
</apex:page>

Wednesday, 12 August 2015

How Rendering a Visualforce page as PDF and saving it as an attachement in salesforce

How can U render a VF (Visualforce ) page as PDF and have a button on the page that saves this PDF as an attachment ?


Apex Class Code:

public class PdfRender{
    public Account acc {get;set;}
    public List<Account> ListAcc {get;set;}
   
   
    public PdfRender(){
    ListAcc = new List<Account>();
    acc = new Account();
    ListAcc =[Select Name,AccountNumber from Account Limit 10 ];
    }
   
    // return 'pdf' if the parameter 'p' has been passed to the page, or null
    public String getSelectRender() {
        if(ApexPages.currentPage().getParameters().get('p') != null)
            return 'pdf';
        else
            return null;
    }
  

    public PageReference RenderedAsPDF() {
        PageReference pdf =  Page.RenderedAsPdf;
        pdf.getParameters().put('p','p');
       

  // Below code to Save Pdf in attachment

        Blob pdf1 = pdf.getcontentAsPdf();
        Document d = new Document();
        d.FolderId = UserInfo.getUserId();
        d.Body = Pdf1;
        d.Name = 'pdf_file.pdf';
        d.ContentType = 'application/pdf';
        d.Type = 'pdf';
        insert d;
    return pdf;
    }
    }

Visualforce Page Code:

<apex:page showHeader="false"  sidebar="false" renderAs="{!SelectRender}" controller="PdfRender" >
    <apex:pageBlock title="Demo Pdf View">
    <apex:pageBlockSection > 
    <apex:pageBlockTable value="{!ListAcc}" var="ac">
                <apex:column value="{!ac.name}"/>
                 <apex:column value="{!ac.AccountNumber}"/>
            </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:form >
    <apex:commandButton action="{!RenderedAsPDF}" value="PDF View" id="theButton"/>
    </apex:form>
</apex:page>

,

How to Dynamically choosing render as PDF in Visualforce (Salesforce)

Render as PDF in Visualforce (Salesforce)

Apex Class Code :

public class PdfRender{
    public Account acc {get;set;}
    public List<Account> ListAcc {get;set;}
   
   
    public PdfRender(){
    ListAcc = new List<Account>();
    acc = new Account();
    ListAcc =[Select Name,AccountNumber from Account Limit 10 ];
    }
   
    // return 'pdf' if the parameter 'p' has been passed to the page, or null
    public String getSelectRender() {
        if(ApexPages.currentPage().getParameters().get('p') != null)
            return 'pdf';
        else
            return null;
    }
  

    public PageReference RenderedAsPDF() {
        PageReference pdf =  Page.RenderedAsPdf;
        pdf.getParameters().put('p','p');
    return pdf;
    }
    }


VF Code :

<apex:page renderAs="{!SelectRender}" controller="PdfRender" >
    <apex:pageBlock title="Demo Pdf View">
    <apex:pageBlockSection > 
    <apex:pageBlockTable value="{!ListAcc}" var="ac">
                <apex:column value="{!ac.name}"/>
                 <apex:column value="{!ac.AccountNumber}"/>
            </apex:pageBlockTable>
    </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:form >
    <apex:commandButton action="{!RenderedAsPDF}" value="PDF View" id="theButton"/>
    </apex:form>
</apex:page>



,

Tuesday, 11 August 2015

SFDC Adm 201 Practice Questions

SFDC Admin 201 Questions


1.A Workflow rule can only be triggered when a record is created.
A.True
B.False

2.Which of the following permissions enables the System Administrator Profile to edit any record, regardless of the Sharing Model?
A.Customize Application
B.Modify All Data
C.View Setup and Configuration
D.None of the above

3.Which of the following fields CAN NOT be a controlling field for Dependent Picklists
A.Standard Picklist
B.Custom Picklist
C.Custom Multi-Select Picklist
D.Standard Checkbox
E.Custom Checkbox

4.When you have exceeded your general storage limit, you can use your complimentary document storage for additional space.
A.True
B.False

5.To make a field required, which of the following is used) (Pick the best possible answer)
A.Page Layout
B.Field Level Security
C.Profile
D.Both Page Layout and Field Level Security

6.What type of information can NOT be shown with an S-Control Dashboard component?
A.Combination of two other Dashboard components
B.External feed of data
C.Data Warehouse information
D.Flash representations of data

7. A new list view can be created from within the console
A.True
B.False

8.All of the following are default Account record types- with Client Management EXCEPT:
A.Account Tab Default
B.Business Account Default
C.Person Account Default
D.Partner Account Default

9.You must be a user of salesforce.com in order to Receive an email notification in the case escalation process
A.True
B.False

10.If a lead is converted without a value in the company field, what happens?
A. A Business Account is created
B. A Person Account is created
C. You will be prompted to decide whether to create a Person or a Business Account
D. Nothing

11.Validation rules are also enforced using the API and Import Wizards.
A.True
B.False

12. Which of the following best describes the Opportunity Stage History related list?
A.By default the list shows ,ALL changes made on the opportunity record
B.The list tracks Stage, Amount, expected Amount, Probability, and Close Date changes
C.The list can be customized to show changes to specific fields on the opportunity
D.None of the above

13.An Approval Process begins when a record is:
A.Created
B.Saved
C.Edited
D.Submitted for Approval

14.      Time based workflow can be triggered every time a record is created Or edited
A.True
B.False

15.When you add a custom object tab, all of the following will be accessible with the object EXCEPT
A.Recent Items
B.Sidebar Search
C.Added to New Link/Create New Object Drop Down
D.Custom Object Reports

16.When you Delete a lead from a campaign, it deletes the lead record itself.
A.True
B.False

17.Which of the following can NOT be used to customize your Home Page
A.Company logo (Image)
B.Dashboard Snapshot
C.Custom Links
D.Custom Formula Field

18.All of the following objects may have a queue EXCEPT
A.Accounts
B.Cases
C.Leads
D.Custom Objects

19.What does the dashboard snapshot on the Home Page display?
A.Only the dashboard determined by the System Administrator
B.The first two rows of any of your available dashboards
C.The first row of any available dashboards
D.You cannot display a dashboard on the Home Page

20.You can use standard reports when creating Dashboards
A.True
B.False

21.Case escalation rules triggered on the last modification will be reset each time a user does which of the following actions?
A.Reads the case
B.Adds a related comment to the case
C.Adds an activity or sends an email from the case record
D.Edits the case
E.All of the above

22.Who can select the "sharing" button on Account and Opportunity records?
A.The Record Owner, System Administrator, and a User shared to the record
B.The Record Owner, a User shared to the record, and any User above the Record Owner in the Role Hierarchy
C.The Record Owner, a User above the Record Owner, and the
System Administrator
D.The Record Owner and System Administrator

23.You can report on converted leads
A.True
B.False

24.You are working with a Professional Edition organization. They wish to install the Expense Tracker which requires the use of 4 custom tabs, 3 custom objects, and one custom app. If the company is already using 4 applications, 36 custom objects, and 7 custom tabs, what will happen when they try to install Expense Tracker?
A.They will not be able to complete the installation process as they have reached the maximum number of custom tabs
B.They will not be able to complete the installation process as they have reached the maximum number of custom objects
C.The installation will succeed
D.The installation will succeed, but only the reports, dashboards and S Control will install

25.What type of report cannot be used to run a dashboard report?
A.Tabular
B.Matrix
C.Summary
D.None of the above

26.Your organization is a US-based company with a default currency of US Dollars. As a sales rep, your personal currency set to British Pounds. You create an opportunity with a currency in British Pounds. The administrator updates the currency conversion rates. Which of the following best describes what happens to the amount of your British-Pound-based opportunity?
A.The overall opportunity amount does not change but the converted amount in a report does
B.The overall opportunity amount and converted amount in a report changes
C.Only newly created opportunities reflect the change
D.Only historically created opportunities reflect the change

27.Custom Links can be used for the following:
A.Launching an External URL
B.Running an S Control
C.Running a report
D.All of the Above

28.It is possible to share a custom object record manually
A.True
B.False

29.You can customize the Opportunity Stage Historyrelated list on an Opportunity Page Layout.
A.True
B.False

30.It's possible to view a forecast based on all of the following  EXCEPT:
A.Territory
B.Product Family
C.Date Range
D.Sales Team

31.Which of the following does a Profile control?
A.Username and Password
B.Role level access
C.Read, Create, Edit, and Delete permissions
D.Sharing rules

32.If a lead, with a single marketing campaign isconverted, the campaign information will map to the newly created contact and opportunity record automatically
A.True
B.False

33.When a manager overrides a subordinate's forecast,the subordinate can see the manager's override
A.True
B.False

34.Related Lists display the many side of a one-to-manyrelationship
A.True
B.False

35.Case Assignment Rules are based on elapsed time
A.True
B.False

36.When test driving an application on the AppExchange Directory, it is not possible to view the S-Control configurations of that application
A.True
B.False

37.Validation rules may evaluate an opportunity line itemagainst the opportunity it's associated with
A.True
B.False

38.All of the following records may be imported via the import    wizards EXCEPT
A.Opportunities
B.Accounts/Contacts
C.Custom Objects
D.Solutions
E.Leads

39.An S-Control may be all of the following EXCEPT:
A.HTML
B.XML
C.URL
D.Snippet

40.If a profile does not have access to an application, thatprofile will also not have access to the tabs and objects of that application
A.True
B.False

41.Which type of field cannot have universal requiredness?
A.Lookup
B.Text
C.Email
D.Number

42.Custom Web Tab may consist of all the following EXCEPT:
A.A URL
B.A URL that passes salesforce.com data like an organization's name
C.An S-Control
D.An S-Control snippit

43.Custom lead fields can be mapped to which sets of objects in salesforce.com?
A.Account, Contact, Opportunity, or Campaigns
B.Account, Contact, or Opportunity
C.Account or Contact Only
D.Contact or Opportunity Only

44.Once a field is hidden from a Profile using 'Field Level Security', a  User associated to that Profile can still see the field using the following:
A.List Views
B.Reports
C.Search
D.None of the above, the user cannot see the field at all

45.It's possible to relate a person account to a contact on a business account.
A.True
B.False

46.Your customer is using Professional Edition. they want the ability to trigger an email every time an opportunity reaches 90% and the amount of the opportunity is one million dollars. What is the best way to accomplish this?
A.Big Deal Alert
B.Workflow Rule
C.Escalation Rule Entry
D.Assignment Rule Entry

47.How is the expected revenue calculated in the opportunity?
A.Amount multiplied by the total price of all opportunity line items
B.The sales price on any line item times the probability of the opportunity
C.Opportunity Amount multiplied by the probability
D.Amount multiplied by the discount percent

48.A custom lookup field can be added to create a relationship  between a standard object and which of the following objects?
A.Users and Custom Objects
B.Leads, Accounts, Contacts and Custom Objects
C.Users, Custom Objects and Campaigns
D.Custom Objects, Contract and Campaigns

49.Assume the Organization Wide default sharing is set to private for all objects and no sharing rules have been created. You have two users in the Sales Rep Role, can they view each other's data?
A.Yes
B.No

50.Based solely on the role hierarchy a manager can do all of the following EXCEPT:
A.View, edit, delete, and transfer his/her and his/her subordinates records
B.Extend sharing on both his/her and his/her subordinate's records
C.View all folders his/her Subordinate has access to, i.e., Reports, Documents, and Email Templates
D.View records his subordinate does not own but can view

51.When you delete a parent record, you will also deletethe child record if that child record has a lookup relationship to the deleted record
A.True
B.False

52.Which action must be taken to view contacts associated with a case in the console?
A.The related lists of the case page layout must be modified
B.The custom links of the case page layout must be modified
C.The related object of the case page layout must be modified
D.The mini page layout of the case page layout must be modified

53.All fields on the Approval page layout are available toview on the Approval History related list
A.True
B.False

54.Which of the following relationships are correct?
A.Lead, Contacts, and Opportunities can be associated to only one Campaign
B.Leads and Contacts can be associated to several Campaigns, but an Opportunity can have only one Campaign
C.Leads and Opportunities can be associated to several campaigns, but Contacts can only have one Campaign
D.Leads, Contacts, and Opportunities can be associated to several Campaigns

55.A Workflow Approval process may be used for all of the following objects EXCEPT:
A.Opportunity
B.Users
C.Assets
D.Contracts

56.Which of the following features is not available in Professional Edition?
A.Big Deal Alert
B.Workflow
C.Account Sharing Rules
D.Multi-Currency

57.The formula editor may be used all of the following places EXCEPT:
A.S-Control
B.Formula Field
C.Default Values on Standard Fields
D.Workflow Field Updates

58.All of the following are types of AppExchange Applications EXCEPT:
A.Composite
B.Client
C.Provisional
D.Native

59.All of the following are true about Default Sales Teams EXCEPT:
A.Default Sales Teams are configured on a user record
B.Default Sales Teams may be added manually to an opportunity record
C.Default Sales Teams may be added automatically to an opportunity
D.Default Sales Teams may be added manually to an account record

60.Which one does NOT apply to Custom Formula Fields:
A.Custom Formula Fields can reference other formula fields
B.Custom Formula Fields can reference standard fields
C.Custom Formula Fields can reference custom fields
D.Custom Formula Fields can calculate across objects

61.Users can be deleted from salesforce.com
A.True
B.False

62.If you are added to a Sales Team with read/write access you then have the ability to extend sharing on the opportunity to other users.
A.True
B.False

63.When configuring Customizable Forecasting, you can set which of the  following Forecast Dates for determining which opportunities contribute to the forecast?
A.Opportunity Close Date Only
B.Product Date Only
C.Schedule Date Only
D.Commit Date
E.Opportunity Close Date, Product Date, Schedule Date

64.Select the best component to use if you want to list the top five sales performers on a dashboard.
A.Chart
B.Table
C.Metric
D.Gauge

65.Custom formula fields are recalculated:
A.Nightly
B.Every twenty minutes
C.Once per user session
D.Each time a user views the record

66.What are the opportunity defaults when converting a lead to an opportunity?
A.Stage Defaults to first option in the picklist, close date defaults to the last day in the quarter, and the amount defaults to blank
B.Stage defaults to first option in the picklist, close date defaults to 3 months from conversion date, and amount defaults to blank
C.User defines amount, close date, and stage upon conversion
D.None of the above

67.What is the difference between the Marketing User Profile and the Marketing User checkbox at the User level?
A.They are the same thing
B.Marketing User Profile allows users to create and edit Campaigns Marketing User checkbox allows users to import Leads.
C.Marketing User Profile allows users to import Leads. Marketing User checkbox allows users to create and edit Campaigns.
D.None of the Above

68.How many other fields may a custom lead field be mapped to when converting a lead?
A.One custom field
B.Two custom fields
C.Three custom fields
D.Custom lead fields cannot be mapped

69.Folders are used to manage:
A.Either Reports, Price Books, Documents. or Email templates
B.Either Reports, Dashboards, Documents, or Products
C.Either Reports, Dashboards, Documents, or Email templates
D.Either Reports, Dashboards, Documents, or Other Folders

70.It is possible for a Page layout to be associated with a Record Type.
A.True
B.False

71.Which of the following object relationships is NOT allowed?
A.Standard object as the "master" and a custom object as the detail
B.Custom object as the master" and a standard object as the detail
C.Custom object as a lookup to a standard object
D.Custom object as a lookup to a custom object

72.Which Custom Object relationship has no effect on deletion or security of the related object?
A.Master-Detail relationship
B.Lookup relationship
C.Open relationship
D.None of the above

73.All of the following actions may take place on a Workflow Rule EXCEPT:
A.Outbound API message
B.Update Field
C.Create a Task
D.Create an Event

74.      All of the following may be used when updating a record using the  AppExchange Data Loader EXCEPT:
A.External Id
B.Parent External Id
C.Record Id
D.Record Number

75.A Record Type may determine the default value of a picklist field.
A.True
B.False

76.With Client Management enabled, when a lead is converted without a value in the company field, it becomes a person account.
A.True
B.False

77.The Campaign ROI Analysis Report uses which of the following calculations to determine the ROI percentage for a campaign?
A.Total Amount of Opportunities / Expected Revenue
B.Amount of Won Opportunities / Budgeted Cost
C.Expected Revenue / Budgeted Cost
D.(Amount of Won Opportunities minus Actual Cost) / Actual Cost

78.You can use standard reports when creating
A.True
B.False

79.The difference between an opportunity record type and a sales process is:
A.The sales process controls the stage field, the record type controls all other picklist fields
B.The record type controls the stage field, the sales process controls all other picklist fields
C.The record type controls the picklist fields
D.The sales process controls all picklist fields

80.An S-Control may be used in all of the following ways EXCEPT:
A.Dashboard Component
B.Custom Button
C.Custom Link
D.Import Wizard

81.Data validation will be enforced when converting a lead
A.True
B.False

82.Assets are related to which of the following sets of objects?
A.Opportunities, Products, Cases, Accounts, and Contacts
B.Products, Cases, Accounts, and Contacts
C.Cases, Contracts, Accounts, and Contacts
D.Opportunities, Cases, and Accounts
E.Opportunity Line Items, Cases, Accounts, and Contacts

83.All of the following may be uploaded to the AppExchange Directory EXCEPT:
A.Custom Tabs
B.Custom Fields on Custom Objects
C.Custom Fields on Standard Objects
D.Custom Assignment Rules

84.Which objects can be customized for history tracking?
A.Solutions, Cases, Leads and Opportunities
B.Cases, Leads, Solutions, Contracts, and Custom Objects
C.Campaigns, Contracts, Custom Objects, and Solutions
D.Opportunities, Leads, and Contracts

85.Fields hidden using Field Level Security are subject to Data Validation Rules.
A.True
B.False

86.If you have Read Only access to an account, can you add a task or event to the account?
A.True
B.False

87.Custom Formula fields do Not support which of the following functional expression?
A.Adding multiple records together
B.If/then/else conditional statements
C.Clickable image buttons
D.Combine text strings together

88.A self service portal user may close their cases using Suggested Solutions in the self service portal.
A.True
B.False

89.Default values are available for standard text fields
A.True
B.False

90.All of the following are true about Opportunity Pipeline and  Forecast reporting EXCEPT:
A.Pipeline reports may include omitted opportunities from the forecast
B.Forecasts may be overridden
C.Pipeline reports may be overridden
D.Opportunity stages may be used to determine the forecast category of an opportunity

Thursday, 6 August 2015

About American Express F2F Interview Questions (salesforce)

 American Express F2F Interview Questions (Salesforce)


Trigger should perform based on user requirement?


It should Trigger when user want to trigger & shouldn’t when trigger don’t want?


What are default methods for Batch Apex?

(Ans: start(), execute() and finish())


Give your explanation on Analytical snapshot?


Types of Triggers?


Other than Data Loader any other way to import Bulk Data?


Explain any scenario occurred you to work beyond Governor Limits?


How u will do Mass Insert through trigger?


If I want to Insert, Update any record into ‘Account’. What trigger I have to use?

About TCS F2F interview Questions (Salesforce)

   TCS Face to Face interview Questions (Salesforce)


Tell us about your projects that you have did ?


What are standard objects used in your project?


Call outs?


Governor Limits?


Relationships


Different types of field types?


Data Migration? Way of Data Migration ?


Roll-up summary?


What is the difference between sales cloud & service cloud?

Accenture Interview Questions (for Salesforce)


Accenture Interview questions for salesforce.com


What is Dynamic Approval process?

Assignment process & validations

Trigger events? & context variables?

Will one workflow effects another workflow?

Case management?

If we want to upload data through DataLoader, what the changes to be done?

Flow of execution in validations, triggers & workflows?
(Ans: all before triggers, Validations, Workflows, All after triggers.)

Difference between Trigger.new & Trigger.old?

Explain Batch Apex? And Why we use it ?

Syntax for upsert & undelete trigger & Purpose undelete?

Capgemini face to face Interview Questions (Salesforce)

 How About Capgemini f2f Interview Questions (Salesforce) ?


Briefly explain about yourself?

What is salesforce architecture?

What all the services provided in cloud computing?

what all the services that salesforce supports?

what is the difference between profiles and roles?

what are web services? why we need to go for them? What is WSDL? What is SOAP?

How can you say that it's "APPROVAL"?
(Someone said first we need to be approved in first round then only we will be sent to the next)

Here you attended capgemini written test. If you got selected here you will be sent to technical round..if you got selected in technical round then you will be sent to HP for client interview, because HP is client to capgemini. If you got selected finally.Then you will be put into work.  This is the scenario. which process do you apply here either "WORKFLOWS" or "APPROVALS".
(Someone said approvals,i don't know whether it's correct or not).

How you will make a class available to others for extension? (Inheritance concept)

In the process of creating a new record, how you will check, whether user has entered email or not in the email field of Account object?

How you will write a java script function that display an alert on the screen?12)What is the value of "renderas" attribute to display o/p in the form of Excel Sheet?

How you will get the java script function into Visual-force page?

Can we create a dashboard using Visual-force page? and what all the components we use here?

What are web tabs?

How you will add an attachment from VF page? tell me the component names to achieve this functionality?

Security(OWD (Organization wide defaults), Sharing Rules,Manual Sharing).

Rate yourself in salesforce?

what is your current package?

How much you are expecting?

You will be given pen and paper, they will ask you to write some simple code.

Deloitte F2F Interview Question (Salesforce)

  Deloitte F2F Interview



 We have 3 objects Account, Contact, Opportunity.   In a VF page, we need to display the names of contact & Opportunity which are related to Account.


One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff.   Write a trigger that should calculate the sum of 3 tasks.  And if any task is modified than trigger should fire automatically & perform the same.

(List<Task> listof tasks = [select id, name from Task where whatId=Trigger.new];)


How can you convert a lead?


What is your Role in your project?


Explain 2 VF pages developed by you?


How will you deploy? Have you ever involved in deployment?


How will you test your code through Sandbox?


What is the custom settings ?


Difference between SOSL and SOQL in Salesforce ?


Custom settings?


What is Sales cloud & Service cloud?


Can a Checkbox as controlling field?


Sharing Rules?


Difference b/w External ID & Unique ID?


What is System.RunAs ()?


Explain  Test.setPage ()?


Why Governor Limits are introduced in Salesforce.com?

Thursday, 30 July 2015

How to convert from 18 Digit Salesforce ID to 15 Digit ID Using Apex Class

How to convert from 18 Digit Salesforce ID to 15 Digit ID Using Apex Class ?

 

String Id= ’00111000009lpABAAY’;
String  Id15Digit = Id15Digit .substring(0, 15);
system.debug(’15 Digit ID”+ Id15Digit );

 Change Code As par your need.

Wednesday, 29 July 2015

How to Insert Account Using Rest API In Salesforce ?


 
@RestResource(urlMapping='/*')
global class InsertAccount
{
    @Httppost
    global static String InsertAccount()
    {  

        // Insert Account Using Post Method

        Account  acc = new Account();
        String jsonStr = null;
        if (null != RestContext.request.requestBody){
        
        jsonStr = RestContext.request.requestBody.toString();
        Map<String, object> m = (Map<String, object>)JSON.deserializeUntyped(jsonStr );
        system.debug('******'+m );
        acc.Name=(String)m.get('AccountName');
        insert acc;
       }
        return 'Account Inserted';
    }
    
    
     @HttpGet
    global static String InsertAccountRest()
    {   

               // Insert Account Using Get Method

        Account  acc1 = new Account();
        acc1.Name=RestContext.request.params.get('AccountName');
        insert acc1;
    
        return 'Account Inserted';
    }
}
 

> For Executing the REST API Please do following steps



  • Select your Environment and API Version then checked the terms of service
  • Then click on Login With Salesforce
 

 Using GetMethod

 
 
  

Using Post Method

 
,

How to use REST API in ? !! Salesforce !!

How to use REST API in   Salesforce ?

This is the Class For REST API

APEX Class 

@RestResource(urlMapping=’/*’)
global with sharing class LocationRESTAPI {
global class Location_Result {
DOuble latitude{get;set;}
Double longitude{get;set;}
string userLocation{get;set;}
Boolean result{get;set;}
}
@RestResource(urlMapping=’/setLocation’)
@httppost
global static void setLocationDetails(Decimal latitude, Decimal longitude,String conId) {
Boolean result = false;
RestRequest request = RestContext.request;
RestResponse response = RestContext.response;
system.debug(‘==latitude==>’+latitude‘longitude====>’+longitude);
try{
Contact con = new Contact();
con.Location__latitude__s = latitude;
con.Location__Longitude__s = longitude;
con.lastname = ‘test';
insert con;
result = true;
}catch(Exception e) {
result = false;
}
response.responseBody = Blob.valueOf(‘{ “result”:’+ result +’ }’);
return;
}
global static String getUserInfo(){
return UserInfo.getProfileId();
}
@RestResource(urlMapping=’/getLocation’)
@HttpGet
global static Location_Result getLocation(){
RestRequest request = RestContext.request;
RestResponse response = RestContext.response;
/*  Location_Result location_Result = new Location_Result();
String contactId = request.params.get(‘ConId’);
system.debug(‘==contactId ==>’+contactId );
Contact con = new Contact(); */
String uId = userinfo.getUserId();
system.debug(‘===uId====>’+uId
User u = new User();
u = [Select Id,ContactId from User where id =: uid];
Location_Result location_Result = new Location_Result();
Contact con = new Contact();
try {
con = [SELECT Name,Title,Account.Name,OwnerId,Location__Longitude__s,Location__latitude__s FROM Contact WHERE id =: u.ContactId]; // Name =: contactName OR Account.Name =: companyName OR Title =: jobTitle  limit 1];
location_Result.latitude = con.Location__latitude__s;
location_Result.longitude = con.Location__Longitude__s;
location_Result.result = true;
}catch(Exception e) {
location_Result.result = false;
}
return location_Result;
}
}
> For Executing the REST API Please do following steps
  • Select your Environment and API Version then checked the terms of service
  • Then click on Login With Salesforce

 

  • After the logged into Workbench you can Choose HTTP Method to perform on the REST API service, (Here I Choose GET Method and Fetch Longitude and Latitude From Contact Record).
  • And also you can see the Raw Response of that particular record by clicking on SHOW RAW RESPONCE ( Here I already select that Link so it’s show me the HIDE RAW RESPONSE )


,

Sunday, 26 July 2015

Best practice to avoid governor limits while writing apex?

 Please check below post . I hope that will help you
https://developer.salesforce.com/page/Apex_Code_Best_Practices



1) One Trigger Per Object
A single Apex Trigger is all you need for one particular object. If you develop multiple Triggers for a single object, you have no way of controlling the order of execution if those Triggers can run in the same contexts

2) Logic-less Triggers
If you write methods in your Triggers, those can’t be exposed for test purposes. You also can’t expose logic to be re-used anywhere else in your org.

3) Context-Specific Handler Methods
Create context-specific handler methods in Trigger handlers


4) Bulkify your Code
Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time.

5) Avoid SOQL Queries or DML statements inside FOR Loops
An individual Apex request gets a maximum of 100 SOQL queries before exceeding that governor limit. So if this trigger is invoked by a batch of more than 100 Account records, the governor limit will throw a runtime exception

6) Using Collections, Streamlining Queries, and Efficient For Loops
It is important to use Apex Collections to efficiently query data and store the data in memory. A combination of using collections and streamlining SOQL queries can substantially help writing efficient Apex code and avoid governor limits

7) Querying Large Data Sets
The total number of records that can be returned by SOQL queries in a request is 50,000. If returning a large set of queries causes you to exceed your heap limit, then a SOQL query for loop must be used instead. It can process multiple batches of records through the use of internal calls to query and queryMore

8) Use @future Appropriately
It is critical to write your Apex code to efficiently handle bulk or many records at a time. This is also true for asynchronous Apex methods (those annotated with the @future keyword). The differences between synchronous and asynchronous Apex can be found

9) Avoid Hardcoding IDs
When deploying Apex code between sandbox and production environments, or installing Force.com AppExchange packages, it is essential to avoid hardcoding IDs in the Apex code. By doing so, if the record IDs change between environments, the logic can dynamically identify the proper data to operate against and not fail

Saturday, 25 July 2015

How to create Contact in the Account As a Related list

 

This post is for insert ACCOUNT as well as its CONTACT.

 

 e.g. see below screeshot :



Create one Visualforce Page.
Create one Class related to that visualforce Page.


Code of Visualforce Page :

<apex:page Controller="AccountDetail">

<apex:form >
    <apex:pageblock title="Account Detail with contact">
        <apex:pageblockButtons location="bottom">
            <apex:commandButton value="Save" action="{!Save}"/>
        </apex:pageblockButtons>
        <apex:outputPanel >
            <apex:pageblockSection title="Account Detail">
                <apex:inputField value="{!account.Name}" />
                <apex:inputField value="{!account.AccountNumber}"/>
                <apex:inputField value="{!account.date__c}"/>
             </apex:pageblockSection>
        </apex:outputPanel>  
        <apex:outputPanel >
              <apex:pageblockSection title="Contact Detail">
                <apex:inputField value="{!contact.FirstName}" />
                <apex:inputField value="{!contact.LastName}"/>
             </apex:pageblockSection>
        </apex:outputPanel>
    </apex:pageblock>
</apex:form>

</apex:page>

Code of Class related to above visualforce Page :

Public class AccountDetail{

    public Account account{get;set;}
    public Contact contact{get;set;}
 
    public AccountDetail(){
       account = new Account();
       contact = new Contact();
    }

 
    public void Save(){
    insert account;
    contact.AccountId = account.Id;
    insert contact;
    update account;
    }

}

 

 

,

Friday, 24 July 2015

How to create Wrapper Class in Salesforce.

Wrapper Class in Salesforce.

http://salesforce-parth.blogspot.in/

 

 Apex Class:

Public class OrderController{
    Public List<Order__c> orderList{get;set;}
    Public WrapperClass singleConditionWrapper{get;set;}
    Public List<WrapperClass> WrapperList{get;set;}

    Public List<System__c> systemList{get;set;}
   
    Public OrderController(){
        WrapperList= new List<WrapperClass>();
        orderList = new List<Order__c>();
        orderList = [select Id,Name,Part_No__c,Opportunity__r.Show_On_Sites_Page__c ,Opportunity__r.Shipping_Company__c,Opportunity__r.Shipping_City__c, Opportunity__r.Shipping_Email__c, Opportunity__r.Shipping_Phone__c, Opportunity__r.Shipping_State__c, Opportunity__r.Shipping_Street__c, Opportunity__r.Shipping_Zip__c  from Order__c where Id =: orderId];
        if(orderList.size() > 0){
            orderName = orderList.get(0).Name;
            isShow = orderList.get(0).Opportunity__r.Show_On_Sites_Page__c;
        }
       
        systemList = new List<System__c>();
        systemList = [Select Id,Name,Serial_Number__c,Asset_Tag__c from system__c where Opportunity__c =: oppId];     
        if(systemList.size() > 0){
            for(Integer i=0; i < systemList.size(); i++){
                singleConditionWrapper = new WrapperClass(systemList.get(i).Name,systemList.get(i).Serial_Number__c,systemList.get(i).Asset_Tag__c);
                WrapperList.add(singleConditionWrapper); 

            }
        }
    } 
    Public class WrapperClass{
        Public String systemName{get;set;}
        Public String serialNumber{get;set;}
        Public String assetTag {get;set;}
   
        public WrapperClass(String systemName,String serialNumber,String assetTag){
            this.systemName=systemName;
            this.serialNumber=serialNumber;
            this.assetTag =assetTag;
        }
    }
}

Visual Force Page:

<apex:page Controller="OrderController" sidebar="false" showHeader="False">
         <apex:pageBlock rendered="{!IsShow != false}"> 
           <apex:repeat value="{!WrapperList}" var="Wap">
             <apex:pageBlockSection id="SectionColor1" title="System Name : {!Wap.systemName} | Serial Number : {!Wap.serialNumber} | Asset Tag : {!Wap.assetTag}  ">
                 
                  <apex:pageBlockTable value="{!orderList}" var="ol">
                     
                      <apex:column headerValue="Part" value="{!ol.Part_No__c}"/>
                      <apex:column headerValue="Shipping Details" value="{!ol.Opportunity__r.Shipping_Company__c} {!ol.Opportunity__r.Shipping_Street__c} {!ol.Opportunity__r.Shipping_City__c} {!ol.Opportunity__r.Shipping_State__c} {!ol.Opportunity__r.Shipping_Zip__c  } {!ol.Opportunity__r.Shipping_Phone__c} {!ol.Opportunity__r.Shipping_Email__c}" />
                      <apex:column headerValue="Ship Date" />
                      <apex:column headerValue="Tracking No" />
                   
                  </apex:pageBlockTable>
                  
                <script>colorPageBlock(document.getElementById("{!$Component.SectionColor1}"), "#484848");</script> 
            </apex:pageBlockSection>
           </apex:repeat>
        </apex:pageBlock>

    </apex:form>
</apex:page>

Thursday, 23 July 2015

How to Crack Dev 401 | Salesforce Dumps 2015 Part 1




 1).  In Data loader 50,000 more records CRUD at a time
A. True
B. False
Ans: A
 2).  ID’s are identical in
A. Production, full copy sandbox, developer
B. Production and full copy sandbox only
C. Production , developer
D. None
Ans:B
 3).  Maximum No of Master Details per child object
A. 1
B. 2
C. 3
D. 4
Ans:B
 4).  For the user object what can you do in the page layout
A. custom link
B. inline vf page
C. custom button
D. custom field
Ans:ABD
 5).  For approval process who can be the submitter
A. profiles
B. roles and subordinates
C. active team members
D. None
Ans: AB
 6).  In Page Layout can you add inline vf
A. True
B. False
Ans:A
 7).  What does out of the box salesforce give you?
A. data warehouse
B. approval process
C. workflow rules
D. validation rules
Ans: BCD
 8).  A developer wants to ensure that when a parent record is deleted, child records are not deleted. Which relationship should the developer choose?
A. lookup
B. master-detail
C. many-to-many
D. master-to-master
E. None
Ans:A
 
 9)). Which statement is true about a custom tab?
A. It can only be included in one application.
B. It can only be included in standard applications
C. It can be included in as many applications as desired.
D. It can only be included in custom applications
Ans:C
 10).  When would a developer use upsert and external IDs?(Choose two answers.)
A. To integrate with an external system
B. To migrate customizations from sandbox to production
C. To load related records without knowing Salesforce record IDs
D. To use the Force.com API to query for data
Ans:AC
 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?
A. the users’ home page layouts to include a dashboard
B. Create a Workflow rule that sends a link to the dashboard in an email.
C. Schedule the dashboard for daily refresh and email distribution.
D. Create a series of daily recurring events providing the dashboard link.
Ans:C
 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?
A. the users’ home page layouts to include a dashboard
B. Create a Workflow rule that sends a link to the dashboard in an email.
C. Schedule the dashboard for daily refresh and email distribution.
D. Create a series of daily recurring events providing the dashboard link
Ans:C
 13).  If you want the a list of positions what dashboard would you use
A. metric
B. table
C. chart
D. gauge
Ans:B
 14).  Time-dependent workflow will not work with which type of workflow evaluation criteria
A. Only when a Record is created
B. Every time a record is created or edited
C. Every kind of workflow evaluation criteria
D. When a Record is edited and it did not previously meet the rule criteria
Ans:B
 15).  Which of the following is a standard Profile?
A. Sales User
B. Marketing User
C. Invoice Manager
D. Contract Manager
Ans:AC
 16).  What is the maximum number of master-detail relationships that can be created on a custom object? Select the Right answer
A. 1
B. 2
C. 4
D. Unlimited
Ans:B
 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
Ans:B
 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
Ans:A
 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
Ans:AB
 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
Ans:D
 21).  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
Ans:C
 22).  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
Ans:AC
 23).  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
Ans:B
 24).  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
Ans:D
 25).  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
Ans:BC
 26).  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.
Ans: B
 27).  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
Ans:C
 28).  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.
Ans:B
 29).  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
Ans:D
 30).  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
Ans:C
 31).  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
Ans:D
 32).  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
Ans:A
 33).  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
Ans:C
 34).  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
Ans:AC
 35).  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
Ans:A
 36).  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
Ans:AB
 37).  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
Ans:BC
 38).  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
Ans:AC
 39).  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
Ans:C
 40).  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
Ans:ACD
 41).  A developer needs to make a field that is normally accessible by most users inaccessible on the report wizard for specific users. What the best method to fulfill that requirement? Choose the Right answer
A. Field level security
B. Remove the field from the page layout
C. Remove the field from the user profile
D. Change my display under personal settings
Ans:C
 42).  What can be done with report summary totals? Please select two (2) choices: Please select two (2) choices:
A. Calculate values from a previous report –
B. Calculations based on report summary totals
C. Highlight outliers
D. Historical analysis
Ans:BD
 43).  If a parent object has a lookup relationship defined with a child object. What happens in the child object when you delete a record from the parent? Choose the Right answer
A. The child record is deleted
B. Nothing
C. The parent record cannot be deleted
D. The child record cannot be deleted
Ans:D
 44).  How can a developer get a Custom Object added to the quick create list Choose the Right answer
A. Add the object through home page component settings
B. It is added automatically
C. Expose a custom tab for the custom object
D. Enable the quick create on the user profile
Ans:C
 45).  Select the features that are available through custom report types. Please select two (2) items. Please select two (2) items.
A. Define object relationships and fields for reports
B. Define up to 4 object relationships
C. Define anti-join relationships
D. Create analytic snapshot reports
Ans:AB
 46).  An organization wishes to have everyone view/edit records on an object except for a single person x who should only have read-only access to the object. What is the best way to implement the requirement? Choose the Right answer
A. Modify the sharing access for the object to public read/write and remove user x from the role hierarchy
B. Modify the sharing access for the object to private and remove user x from the role hierarchy
C. Modify the sharing access for the object to public read only, create a public group with everyone except user x; create a sharing rule and define read/write access to the public
group.
D. Modify the page layout to be read-only.
Ans:C
 47).  Using a formula field how would a developer calculate the number of days since a record has been created. The CreatedDate field is a DateTime type field. Choose the Right answer
A. TODAY() – DATEVALUE(CreatedDate)
B. NOW() – DATEVALUE(CreatedDate)
C. TODAY() – CreatedDate
D. CreatedDate – TODAY()
Ans:A
 48).  Salesforce.com has notified you that they have enabled the ability to update audit fields for your organization. When inserting a record which field can you set? Choose the Right answer
A. CreatedDate
B. IsDeleted
C. SysModStamp
D. UpdatedDate
Ans:A
 49).  A developer needs to create a trending report what should he/she use to get the historical data? Choose the Right answer
A. Reports
B. Analytic Snapshots
C. Roll-Up Summary
D. Report Types
E. Audit History Records
Ans:B
 50).  What is the best type of dashboard component to display a list of your top 10 customers? Choose the Right answer
A. Metric
B. Table
C. Gauge
D. Chart
Ans: B
 51).  Select the salesforce.com edition that is NOT available today Choose the Right answer
A. Professional
B. Unlimited
C. Enterprise
D. Premium
Ans:D
 52).  Using the force.com platform declarative model to build an application. Which of the following do you NOT have to do? Please select three (3) choices.
A. Install a database server
B. Configure an application using clicks not code
C. Deploy a web server
D. Administer and email server
Ans:ACD
 53).  An organization wants to create a field to store manager data on the user object. The manager field is a reference to another user record. What type of relationship should be used?
Choose the Right answer
A. master-detail
B. hierarchical
C. lookup
D. many-to-many
Ans:B
 54).  What are the data types that are supported by formula field? Please select three (3) choices. Please select three (3) choices.
A. Text
B. Percent
C. Email
D. Currency
E. Phone
Ans:ABD
 55).  What is true about a junction object? Choose the Right answer
A. A custom object that has 2 master-detail relationships.
B. A custom object that has a master-detail relationship.
C. A standard object that has 2 master-detail relationships.
D. A standard object that has a master-detail relationship.
Ans:A
 56).  What is true about a cross-object formula field for a master-detail relationship? Choose the Right answer
A. You can only create a cross-object formula field on the parent object.
B. You can only create a cross-object formula field on the child object.
C. You can create a cross-object formula field on both the parent and child object.
D. Cross-object formula field is not available for master-detail relationship.
Ans:B
 57).  When you create a custom tab for a custom object, what are the features that are available by default? Please select two (2) choices.
A. Sidebar Search Object
B. Custom Reporting
C. Quick Create
D. Ability to track Activity
Ans:AC
 58).  What are the different custom tabs that you can create? Please select three (3) choices. Please select three (3) choices.
A. Web Tab
B. Apex Tab
C. Visualforce Tab
D. Custom Object Tab
E. Standard Object Tab
Ans:ACD
 59).  For the order management application, the developer has created a custom object to store the product line and product combination. When creating an order, the product line and product combination needs to be consistent. What is the best option for implementing this? Choose the Right answer
A. Use a workflow to update the product automatically based on the product line.
B. Create a validation rule using IF
C. Create a formula field to enforce the combination
D. Create a validation rule using VLOOKUP
Ans:D
 60).  What is true about a master-detail relationship? Please select two (2) choices. Please select two (2) choices.
A. When the parent record has been deleted, all the child records will be deleted.
B. You can have a child record without the parent record.
C. You have to expose the master lookup field on the child detail page layout.
D. You cannot delete a child record.
Ans:AC
 61).  How do Salesforce enforce data access using role hierarchy? Choose the Right answer
A. Users are given access to the records owned by the users who are below the role hierarchy.
B. Users are given access to the records owned by the users who share the same role on the role hierarchy.
C. Users are given access to the records accessible by the users who are below the role hierarchy.
D. Users are given access to the records accessible by the users who are above the role hierarchy.
Ans: C
 62).  What will cause the analytic snapshots run to fail? Please select three (3) choices. Please select three (3) choices.
A. The source report has been deleted.
B. The target object has a trigger on it.
C. The running user has been inactivated.
D. The target object is a custom object.
E. The source report is saved as Matrix report
Ans:ABC
 63). What are the components belong to the Model of the Model-View-Controller design paradigm? Please select three (3) choices.
A. Custom Relationship
B. Custom Page Layout
C. Custom Object
D. Custom Field
E. Workflow Rules
Ans: ACD
 64).  Where do you change the Hover detail? Choose the Right answer
A. Mini View
B. Page Layout
C. Profile
D. Mini Page Layout
Ans:D
 65).  What layer of model-view-controller paradigm does standard or custom objects associated with? Choose the Right answer
A. View
B. Model
C. Controller
D. View and Controller
Ans:B
 66).  What is a junction object? Choose the Right answer
A. Object with lookup relationship
B. Master detail relationship
C. Object with two lookup relationship
D. Object with two master-detail relationship
Ans:D
 67).  What field can be controlled by translation workbench?
A. Rule Criteria
B. Formula
C. Validation Errors
D. Assignment Rules
Ans:C
 68).  In a master-detail relationship, what happens when the a record is deleted from parent object Choose the Right answer
A. Parent record alone gets deleted
B. Exception occurs
C. Parent and Child record will not be deleted
D. All child records are deleted
Ans:D
 69).  In a recruiting application, Salary is a child object to parent Position object via master-detail relationship. The min pay and max pay fields of salary object cannot be modified when Position status on the parent is “Approved”. How would a developer design this?
A. Create a Visualforce component on Position detail page
B. Rollup-Summary Field
C. Validation rule on Position object
D. Formula field on the Salary object
E. Validation rule on the Salary Object
Ans:E
 70).  Object X has a lookup to Object Y. What among the following statements are TRUE Please choose two (2).
A. Fields of both X and Y are accessible from Object Y.
B. Fields of Object Y can be accessed from Object X.
C. Fields of both Y and X are accessible from Object X.
D. Fields of Object X can be accessed from Object Y.
Ans: BC
 71).  In master-detail relationship scenario where the fields of the parent object needs to be displayed in the related list. How will a developer design this: Choose the Right answer
A. Cross-object formula field
B. Workflow rule
C. Validation Rule
D. Assignment rule
Ans:A
 72).  What are the components of the dashboard that use grand totals Please choose two (2) items.
A. Chart
B. Metric
C. Table
D. Gauge
Ans:B
 73).  Universal Containers needs to make all records of an object visible to all users when it is in “Approved” status. The records are created with “New” status and are only visible to a select set of users. How will a developer implement this? Choose the Right answer
A. Set the object level sharing to Private, add a workflow rule to update the sharing rule when status changes.
B. Set the object level sharing to Public Read-Only, restrict the sharing when status is ‘New’.
C. Set the object level sharing to Private, create a public group with appropriate users, modify manual sharing to public group based on status
D. Create role hierarchy, modify the user profiles when status changes
Ans:C
 74).  In a master-child relationship between a standard object and custom object. Which of the following statements is NOT true. Please select two (2) items
A. Standard object is always the master
B. Custom Object is always the master
C. Custom object is always a child
D. Standard or custom object can be a master
E. Standard object is never a child
Ans:BD
 75).  A customer has a requirement to filter on columns in the related list. As a developer how will you accomplish Choose the Right answer
A. Use the filter option in the related list section of the Page Layout
B. Use the filter option in the related list section of the Mini Page Layout
C. Use the filter option in the detail page layout of the related list object
D. Build a visual force component with filter to replace the related list section of the Page Layout
Ans:A
 76).  How do you highlight totals in a report Choose the Right answer
A. Roll-up Summary Field
B. Formula Field
C. Custom Summary Field
D. Summary Totals
Ans:D
 77).  Recruiting application has a Position object that contains location, department and other information relating to a position. A report needs to customized that is grouped by department but not on locations. What is the best type of report would a developer choose? Choose the Right answer
A. Summary Report
B. Tabular Report
C. Matrix Report
D. A report using visual force
Ans:A
 78).  A job application object has a child review object to store candidate review. The review needs to be tracked between a score of 1 to 5. The score has to be a choice between 1 and 5 displayed as a radio button. How will a developer cater to this requirement? Choose the Right answer
A. Create 5 fields for scores (1 to 5) of type radio-button and use it in review page layout.
B. Create a dependent picklist that feeds the radio button type field.
C. Create a formula field
D. Create visual force page with radio buttons for review object
Ans:D
 79).  In a data model object A is related to B, B is related to C. How will a developer create a report to include fields of A and C. Choose the Right answer
A. Create lookup relationships between A,B and C
B. Create a Custom Report type with A, B and C, and use it in the report
C. Create a custom report with A and C fields as relationships already exist
D. Report cannot be created Custom Objects automatically have some standard fields
Ans:C
 80).  Custom Objects automatically have some standard fields
A. True
B. False
C. Some of them have
Ans:A
 81).  Custom Tabs have properties such as: Select all that are true
A. Custom Fields
B. Relation to other objects
C. Page Layouts
D. User Tabs
E. Audio Visual Capabilities
F. They do not have any properties
Ans:F
 82).  Changing the data type of existing custom field is possible, but doing so may cause loss of
data
A. True
B. False
C. Maybe
Ans:A
 83).  Custom Fields are store for how many days after deletion
A. 10 Days
B. 30 Days
C. 45 Days
D. 100 Days
Ans:C
 84).  Standard Picklist cannot be a dependent picklist Choose the correct answer
A. It can be in some cases
B. It depends on the version of Salesforce.com you are using
C. This is correct, Standard picklist can only be a controlling picklist
D. This is incorrect, Standard picklist can be a controlling as well as dependent picklist
Ans:C
 85).  Required and Unique field options works on Custom Fields only True or False
A. True
B. False
Ans:A
 86).  Fill in the blanks. Encrypted fields allow for masking data for all users except those with the ———— permissions Fill in the blanks
A. Read all data
B. View all Data
C. Modify all data
D. Administrator permissions
Ans:D
 87).  The Force.com platform supports the following relationship types Select all which apply
A. Self
B. Lookup
C. Master Detail
D. Many to Many
E. Many to All
F. One to One
G. One to all
H. Validation Rules
Ans:ABD
 88).  Fill in the blanks. ______________ lookup relations are allowed per object Fill in the blanks
A. 10
B. 20
C. 25
D. 40
Ans:C
 89).  Junction Object is a Custom Object with three master detail relationships True or False
A. True
B. False
C. Sometimes it has
Ans:B
 90).  Any member in a Queue has the same access to all records in the queue that an owner would have.
A. True
B. False
C. Not always
Ans:A
 91).  Select which is not applicable. Capabilities of a Workflow includes, Not Applicable to be
selected
A. Tasks and Alerts
B. Field Updates
C. Run Reports
D. Outbound Messaging
E. Approval Processes
F. Dashboard Refresh
G. Load Data through Data Loader
Ans:CEFG
 92).  A queue is a location where records can be routed to wait processing by a group member
A. True
B. False
C. Maybe sometimes
Ans:A
 93).  Roll up Summary Field works in the case of which relationship Select the correct choice
A. Master Detail
B. Master Master
C. Workflow
D. Validation Rules
E. Lookup
F. Do not lookup
G. Master to all
Ans:A
 94).  Validation Rules can contain a Formula or an expression that evaluates the data in one or more fields and returns a value of “True” or “False”
A. True
B. False
C. Maybe sometimes
Ans:A
 95).  Workflow Rules are automated processes that trigger criteria based on your business requirements True or False
A. True
B. False
Ans:A
 96).  Profile have the following permissions All Applicable to be selected
A. View All Data
B. Delete All Data
C. Modify all data
D. Customize Application
E. Data Loader only user
F. Password never expires
G. Load Data through Data Loader
Ans:ACDF
 97).  Cross Objects formulas can reference fields on parent or grand parent object up to how many levels Select the correct choice
A. 2
B. 5
C. 8
D. 12
Ans:B
 98).  Custom Formula fields can reference fields on related objects True or False
A. True
B. False
Ans:A
 99).  In Rollup Summary there is an option to include all records in the roll-up or just that meets certain criteria True or False
A. True
B. False
Ans:A
 100).  User can have access to more than one record types for an object True or False
A. True
B. False
Ans:A

Get Gmail, Docs, Drive, and Calendar for business