Thursday, 8 December 2016

SQOL to know Code coverage in Salesforce


Salesforce provides developers a way to find out Codecoverage details. 
Write a SQOL by using  “ApexCodeCoverageAggregate”  to know Code coverage for all Apex Classes and Apex Triggers withing fraction of seconds. 

* SOQL :

SELECT ApexClassOrTrigger.Name, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate


Tips : 

* Use of "ORDER BY" clause will let you have your result more presentable.

e.g. 

SELECT ApexClassOrTrigger.Name, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate ORDER BY  ApexClassOrTrigger.Name ASC




* Make sure that you have enabled "Use Tooling API" check box in Developer Console to execute following query.  (see following image - Red circle)




Tuesday, 5 January 2016

@ReadOnly


 
  @ReadOnly
 

  •  Because of Limitations like 'Maximum no.of items in a collection that can be iterated is 1000' or 'generally query in VF should not go beyong 50,000 rows'.  It was not possible to show millions of records on VF page.                                                                                                     But thanks to @ReadOnly annotation in API version 23.0 now we can !
  • Only available for Web services and the Schedulable interface.
  • Used for methods.
  • Allows you to perform unrestricted queries against the Force.com database.  All other limits still apply.
  • To use the @ReadOnly annotation, the top level request must be in the schedule execution or the Web service invocation. 
   For example, if a Visualforce page calls a Web service that contains the @ReadOnly annotation, the request fails because Visualforce is the top level request, not the Web service.


  • ReadOnly mode restricts you from DML Operations, calls to System.Schedule, Sending an emails, calls to @Future annoted methods.
  • @ ReadOnly methods should also have @Remote action annotation and either global/public or static access specifiers.
  • Visualforce controller methods with the @ReadOnly annotation automatically take advantage of read-only mode and help us to retrieve a larger collection of records.
  • Very helpful and handy in a visualforce controller for building super custom reports.


  More : 
  https://success.salesforce.com/ideaView?id=08730000000kourAAA

@Deprecated


 @Deprecated  

  • Used in managed packages
  • Any classes,methods, interfaces, exceptions,variables or enums ,etc which can no longer be referenced in subsequent releases (of that Managed Package).
  • Mostly used when you are refactoring / making more changes/improvements in your Managed Package as the requirements evolve.
  • It restricts new subscribers to see "deprecated" elements while existing subscribers/API integrations  get proper functioning elements as they were.
  • All 'global' modifiers need to be 'deprecated' as who referred your 'decprecated' element.
  • Unmanaged packages cannot contain code that uses the deprecated keyword.
  • Can't use with WebSerivces
  • Enum, Interface, Abstract classes need to depcrecated totally - cant decpracate individual method or individual enum value.

 EXAMPLE : 

       
            // This method is deprecated. Use myOptimizedMethod(String a, String b) instead.
  @deprecated 
  global void myMethod(String a) { 
 }

Tuesday, 22 December 2015

Salesforce App Builder Dumps Certification - Sample

The questions listed below are samples not the real ones, but they will give you the direction for sure –
(Keep visiting - will be updating with more Questions soon)

1)  Universal containers has included its orders as an external data object into Salesforce. You want to create a relationship between Accounts and the Orders object (one-to-many relationship) leveraging a key field for account which is on both external object and Account. Which relationship do you create:
a) Lookup Relationship
b) Master Detail Relationship
c) Hierarchical Relationship
d) external Lookup Relationship
E) indirect Lookup Relationship

2)    Universal Container want to store an area code and wants to be able to search for it in applications (apex). Which are possible fields to store the data (choose 2):
a) Text
b) Phone
c) Email
d) Multi Picklist
e) Number 

3)    You want to use an External Data Object Table from Heroku carrying Product Category information. The data need to be included in Salesforce and searchable. What do you have to do before you can use the connection (choose two):
a) press “validate and sync”
b) choose “include in Salesforce searches” option
c) choose “include as index field”
d) URL / choose the URL (?) 

4)    Universal containers has a custom object that has a N:M relationship with opportunityLineItem carrying price and amount information. In order to compute total amounts and total prices per Opportunity using Rollup summary fields, what field type will you use (choose one)
a) Junction
b) Master-Detail
c) Lookup
d) Crossobject 

5)    Universal Container installes an unmanaged package. Which of the following are true: (choose 2):
a) Components of unmanaged packages can be edited
b) Unmanaged packages can be upgraded
c) Unmanaged packages have a namespace prefix
d) Unmanaged packages don’t have a version number
e) Tests are executed during deployment 


6) Describe the capabilities of this core CRM object in the Salesforce schema: Person accounts (Choose 2)
a.        Does use space in both account and contact table
b.      Have the same icon as business accounts
c.       Can only be merged with other person accounts
d.      Are enabled by default
e.      Are enabled via featured license

7)    Universal Containers wants to rollout new product bundles with several pricing options. Pricing options include product-price bundles, account specific pricing and more. Which product satisfies these needs?
a.       Custom AppExchange App for product pricing
b.      Workflow on Opportunity/Opportunity Product
c.       Formula fields on Opportunity/Opportunity product
d.      Lightning Process Builder

8)    Object specific actions can not be added. Visualforce needs to be embedded into a Lightning page. Universal Containers has a custom object “Service” which has a lookup relationship to Account. Universal Containers wants to enhance Salesforce1 with an action that allows account managers to enter a new Service to an Account while looking at the Account. How can Universal Containers accomplish this?
a.       Enter an object specific action to Account and put it on the Account layout
b.      Enter an object specific action to Service and put it in the Account Layout
c.       Enter an object specific action to Service and put it in the Service Layout
d.      Enter an object specific action to Account and put it in the Service Layout

9)    Universal Containers is using assignment rules to distribute cases to regional teams. Which of the following are true?
a.       It is possible to have multiple active assignment rules.
b.      Cases may be assigned to public groups (if configured)
c.       Cases may be assigned to queues (if configured)
d.      A workflow field update can be used instead

10)    When should a system administrator consider using the Salesforce AppExchange? (Choose 2)
a.       When standard Salesforce functionality needs to be extended
b.      To find answers to Salesforce application questions
c.       When looking for pre-built custom applications and tools
d.      To submit ideas for Salesforce application enhancements

11)    Which permission is required to install and uninstall packages from Salesforce AppExchange?
a.       Upload AppExchange Packages
b.      Manage Package Licenses
c.       Download AppExchange Packages
d.      Create AppExchange Packages

12)    Which developer tool can be used to create a data model? (Choose 4 )  
[Note:  In exam you will get any 4/5 options and you need to Choose any 2 out of them]

a.       Schema Builder
b.      Force.com Data Loader
c.       Application Data Model Wizard
d.      Force.com IDE
e.     Force.com Application Setup Menu
f.      Metadata API

13) Which API cannot be used to create the data model? (Choose 3)
a.       Force.com API
b.      Force.com Single Sign-on API
c.       Force.com Metadata API
d.      AJAX Tookit for Force.com

14) When considering Field Type Conversion, which of the following are true? (Choose 2)
a.       Data can be lost when converting from simple picklist to multi picklist
b.      Data can be lost when converting from autonumber to text
c.       Data can be lost when converting from number to currency (assuming that field lengths are identical)
d.      Information ca be lost when converting from text area(rich) to text area(long)

15) Universal Containers wants to store an area code and wants to be able to search for it in searches. Which are possible fields to store the data? (Choose 2)
a.       Text
b.      Phone
c.       Email
d.      Multi Picklist


16) Universal Containers wants to store an area code and wants to be able to search for it in applications(apex). Which are possible fields they could use to store the data? (Choose 2)
a.       Text
b.      Phone
c.       Email
d.      Multi Picklist
e.      Number

17) Which of the following fields are not available for record types?
a.       Opportunity Stages
b.      Case Status
c.       Solution Status
d.      Lead Status
e.      All above

18) What determines whether a user can create a new record using a specific record type?
a.       Profile
b.      FLS
c.       Page Layout
d.      Sharing

19) Which statement about record types is true?
a.       Record types can be used to define picklist values available for a given field
b.      The ability to create records of a specific record type is determined by the profile
c.       Users cannot view records assigned to a record type their profile does not have access to
d.      Record types can only be assigned to one profile at a time

20) Which functions are available when creating a Roll-Up Summary field? (select all that apply)
a.       AVG
b.      SUM
c.       MAX
d.      COUNT
e.      MIN

21) Which statements are true regarding Roll-Up Summary fields? (select all that apply)
a.       Once created, you cannot change the detail object selected or delete any field referenced in your roll-up summary definition.
b.      Because roll-up summary fields are not displayed on edit pages, you can use them in validation rules.
c.       Validation errors can display when saving either the detail or master record.
d.      Advanced currency management has no affect on roll-up summary fields.
e.      Automatically derived fields, such as current date or current user, are allowed in a roll-up summary field.

22) Describe the ramifications of field updates and potential for recursion for the following scenario:
If a field update for Rule1 triggers Rule2, and a field update for Rule2 triggers Rule1.
a.     The updates create a loop and the org limits for workflow time triggers per hour will likely be violated.
b.    When the second trigger is saved a Imminent Loop Error message will be displayed and the workflow rule update will not save.
c.     The updates create a loop and the org be blocked until the admin resolves the issue
d.    Loop is allowed to run 25 times within one hour. If it does not end on its own the process will be stopped by R&D.

23) What is true when a field update is set to re-evaluate the workflow rule? (choose three)
a.     In a batch update, workflow is only retriggered on the entities where there is a change.
b.    Only workflow rules on the same object as the initial field update will be re-evaluated and triggered.
c.     Only workflow rules that didn’t fire before will be retriggered.
d.    Cascade of workflow rule re-evaluation and triggering can happen up to ten times after the initial field update that started it.
e.    Any workflow rules whose criteria are met as a result of the field update will be ignored.

24) Identify the field update limitations. (choose three)
a.     Field updates that are executed as approval actions don't trigger workflow rules.
b.    Read-only fields like formula or auto-number fields aren't available for field updates.
c.     The results of a field update can't trigger additional rules such as validation, assignment, auto-response, or escalation rules.
d.    In a batch update, workflow is retriggered on all entities where there is a change.

25) What is true about social accounts :
a.     You can use social accounts data even when you are not logged into the social account.
b.    You need a personal social account in order to see social account data
c.     You can use social accounts to import data into salesforce
d.    Connection to social account is established thru a company wide “named principal”

26) A salesperson at AW Computing only see’s the Social Contact’s link for Twitter and not Facebook on his records. Why would this be happening?
a.     The administrator hasn't enabled Social Contacts for Facebook
b.    Facebook is no longer supported by Social Contacts
c.     The salesperson's login with Facebook has expired
d.    None of his Facebook contacts have confirmed the nature of their relationship

27) Which social networks are available in the Lightning Experience and Salesforce1? (select all that apply)
a.     Facebook
b.    Twitter
c.     LinkedIn
d.    Klout

28) A Lightning Page is?
a.     A page you can access via a customer community.
b.    The new name for a Salesforce page layout.
c.     A custom layout for creating pages in Salesforce1.
d.    A compact, configurable, and reusable element.

29) What can you build with the Lightning App Builder?
a.     At-a-glance, dashboard-style apps.
b.    Apps optimized for a particular task.
c.     Simple, single-page apps with drill-down capability.
d.    All of the above

30) Actions on a Lightning Page allow you to do which of the following?
a.     Send email, create a task, and create or update records.
b.    Send email and delete or clone records
c.     Clone records, add users, and assign permissions.
d.    Send email, send outbound messages, and launch a flow.

31) Which components can be added to a lightning app on custom Object? (choose 3)
a.     Visualforce component
b.    Standard Lightning component
c.     Custom Lightning component
d.    Global actions
e.    Object specific actions on the custom object


32) In order to create an App Launcher component in Lightning what must an admin do?
a.     Contact Salesforce to have the component activated for the Lightning App Builder.
b.    Navigate to Setup-Customize-User Interface to enable the component for the Lightning App Builder.
c.     Purchase a license for the Lightning App Builder.
d.    Join the pilot Lightning App Builder team

33) Identify the standard Lightning components. (choose three)
a.      List View
b.    Rich Text
c.     Visualforce Page
d.    Reports
e.    Dashboards

34) You can create global actions to let users create which of the following records? (choose three)
a.     Event (without invitees)
b.    Opportunity
c.     Question
d.    Users
e.    Chatter posts
f.     Products

35) What standard Chatter actions (Post, File, Link, Poll, and Thanks) appear on the user profile page, regardless of the actions in the User page layout? (choose three)
a.     Post
b.    File
c.     Poll
d.    Create
e.    Email

36) When a user creates a record by using an object-specific create action, what feed item for that record appears?
a.     In the Chatter feed of the user who created the record
b.    As the first entry in the feed for the new record
c.     In the feed for the record on which the new record was created
d.    In the user profile feed for all users who can view the record
e.    In the Chatter feed of teh first user who follows the record on which the record was created

37) To enable the Publisher Actions area on Page Layouts, navigate to
a.     Setup | Customize | Chatter | Settings
b.    Setup | Customize | Feeds | Settings
c.     Setup | Customize | <Objects> | Settings
d.    Setup | Customize | Actions | Settings

38) A developer has completed work in the sandbox and is ready to send it to a related org, what deployment tool should be used ?
a.     Change Sets
b.    Force.com IDE
c.     Unmanaged Packages
d.    Force.com Migration tool

39) You have created a workflow rule to send an email in your configuration sandbox. For some reason its not working, what should you double check? (Choose 2)
a.     You have the correct email address
b.    HTML does not work in sandbox, make sure your email has no HTML
c.     Check the deliverability settings
d.    Look at the system audit trail
40) Universal Container installs an unmanaged package. Which of the following are true? (choose 2
a.     Components of unmanaged packages can be edited
b.    Unmanaged packages can be upgraded
c.     Unmanaged packages have a namespace prefix
d.    Unmanaged packages don’t have a version number
e.    Tests are executed during deployment

41) Which deployment tools will you use to deploy metadata from one organization to another organization?
a.     Change sets
b.    Force.com IDE
c.     Unmanaged Packages

42) What tools you need to use to migrate Metadata to Two Different Production Orgs? (Choose 3)
a.     Force.Com IDE
b.    Force.Com Migration Toolc
c.     Change Set
d.    Data Loader
e.    Unmanaged Package


ANSWERS :

Question
Answer
Question
Answer
1
E
21
A, B,C
2
A, E  (after creating an index on the number field)
22
A
3
A, B, D
23
A,B,C
4
B, A
24
A, B, C
5
A, E
25
B
6
A, C
26
A
7
A
27
B
8
A
28
C
9
C
29
D
10
A, C
30
A
11
C
31
B,C,D
12
A, D, E,F
32
A
13
A, B, D
33
A,B,C
14
34
A,B,C
15
A, B
35
A,B,C
16
A, E
36
A,B,C
17
E
37
A
18
A
38
A
19
A , B
39
A,C
20
B,C,D,E
40
A,D


41
B


42
A,B,E




































Courtesy  : Sfdcstudy