Showing posts with label Salesforce FAQ. Show all posts
Showing posts with label Salesforce FAQ. Show all posts

Friday, 1 June 2018

Salesforce Advanced FAQ


1. Give me code free solution to validate duplicate check on combination of First & Last Name?

  • Create a formula field to get the concatenation of First & Last Name
  • Create a custom field to hold the value of formula field & Declare this field as unique
  • Create Work flow rule & Field Update action on every record creation/update save the above mentioned formula field value into custom field
  • So since the custom field we declared as Unique it will not allow any duplicate entry

2. Can we disable triggers in production ?

    Triggers are not editable once deployed,
    Alternate solution is Using Force.Com IDE / Change Sets,Inactive/Disable the trigger
    and deploy to the production

   Any other solution with out deployment?

    Yes,It's design solution :
  •     Create configuration [Custom Setting / Custom Metadata Type] to maintain the flag                    for each trigger execution
  •     Execute the trigger logic based on the above flag selection

 3. In which below scenario users will  be able to edit each others records ?

 
  In either of scenario the answer is "NO"
      Profile - Object level permission 
      OWD -   Record level permission 

4. Is it possible to achieve Many to Many relation ship by using look up relationships?

     Junction Object : This is a custom object with 2 Master - Detail relationships & is the key to             making  Many to Many relation ship.

     To answer the question ,Yes it is possible.

     The downside is ,Junction object will not be automatically deleted when one or both of the                   objects it is relating are deleted.

5. What is the difference between Indirect Lookup and External Lookup ?

Indirect Lookup Relationship
External Lookup Relationship
This type is basically when Standard/Custom object as parent and an External object as child.
This type is basically when External object as parent and external/standard/custom object as child.
Only objects that have a custom field with the External ID and Unique attributes are available as parent objects in indirect lookup relationships.
The External ID standard field as parent field matching
Use Case :
When the external data doesn’t include Salesforce record IDs.
Use the External Id as link between External & SFDC object.
Use Case :
Use an external lookup relationship when the parent is an external object.
Ex:
Account record (parent standard object) displays a related list of SAP sales orders (child external object) with matching customer IDs that aren’t Salesforce IDs.
Ex:
External product catalog item (parent external object) displays a related list of support cases (child standard object)


6.If the Workflow field update & Trigger on the same set of attribute and action,Will it fall under infinite loop ?

   Not actually,
   If the record was updated with workflow field updates,fires before and after triggers one more           time (and only one more time),In addition to standard validations.Custom validation rules are not       run again.

7.What is the difference between Process Builder  and Lightning flow?

   Workflow / Process Builder : Which always executes rules and actions behind the scenes.
   Visual Flow / Lightning Flow : Which are applications that are user-triggered instead of event-        triggered.

8.Give me different ways to invoke an apex call out from Queueable class?

  • Create a future method with call out operation & Call the future method in Queueable execute method
  • Implement the "Database.AllowCallouts" interface along with the "Queueable" interface to enable the call outs.Create a public static function that performs a call out and call that from Queueable execute method.

9. When is best to use Profiles instead of Permission Sets?

      Profile for core level & Permission Sets used to give extended permissions
      Profiles : Set access to Tabs,Apps,record types,Page layout assignment etc
      Permission Set :To give access to only certain user in the profile
      Note : Permission sets can only grant access,But can not deny access

      To answer to the question,Profiles are best to control Field Level security.

10. What is the significance of Geo fields on an object ?

      To create Geo fields there is a datatype "Geolocation" ,Which allows users to define locations.
      Includes latitude and longitude components and can be used to calculate distance.


11.Which are the possible ways to search within Salesforce ?

  • Global Search
  • Advanced Search 
  • Sidebar Search 
  • Lookup Search

12.Difference between SOQL & SOSL ,Which one is very effective at different point of time ?

SOQL
·         SOQL can query on all fields of any data type on single multiple objects which are related.
·         SOQL cannot be queried against encrypted fields
·         DML operations are possible on search result

EX: 
SELECT Id, Name FROM Contact WHERE Name Like 'Deepika%'
SOSL
·         SOSL enables you to search text, email, and phone fields for multiple objects simultaneously ,That objects can be related/ non-related
·         SOSL can query against encrypted fields
·         DML operations are not possible on search result

EX:
FIND {Deepika Matam} IN Name Fields RETURNING Contact(name, phone)

Note : Earlier SOSL was not allowed in Triggers but from Spring 11 on-words its allowed.



13.What are the authentication access types for a Force.Com Canvas Application ?

Force.com Canvas Framework :This allows you to take your existing web-based applications and expose/integrate them inside of Salesforce.
Salesforce becomes single screen to access your key applications using Force.com Canvas Framework.

Canvas App Previewer used configure the app & view it.

Authentication Methods :

  • Signed request
  • OAuth 2.0
Canvas App level Authentication Can Be :
  • No Authentication
  • Username / Password
  • SAML
  • SSO 
It is 2 sides authentication ,Together end user get's access

14.When would you use oAuth vs OpenID?


Actually both can be used as combination
OpenID : Authentication protocal
oAuth : Authorization framework

15.What are the different flows in oAuth,State few examples ?

The oAuth framework provides 4 different types of authorization flows

Flow Type
Example
Authorization Code
LinkedIn to Twitter connect without providing Twitter credentials
Implicit grant
Mobile App à DueLingo ,When install 1st time there is an option to login though google/facebook identity.

Resource Owner Password Credentials
Facebook / LinkdIn Mobile Apps,
Facebook app redirecting to same Facebook so can enter credentials in this app.
Client Credentials Grant

The real estate search engine, An anonymous user of this portal can make search for property.

Note :
1.    Authorization code & Implicit grant mostly same but Authorization Code is more secure than this Implicit Grant.
2.    Implicit Grant doesn't involve any server side code or activity. It’s only between the client and the third party API that the user wants to access.
3.    The Client Credentials Grant is a flow that doesn’t involve any end-user. 

Refer Here For More Details

16.Can we search and sort based on a formula field on an object in Salesforce?

Global search won't search formula fields.
Sorting a report by formula field is not possible.
Note :  Formula fields can be used SOQL Where clause


17. What are the important points to know about encrypted fields ?       

  1. User profiles who have the “View Encrypted Data” configuration enabled will be able to view the field normally.
  2. Users who do not have the “View Encrypted Data” profile will see the mask.
  3. User profiles that have the “Modify All Data” permission will not be able to see the value of encrypted data fields.
  4. The field length is restricted to 175 characters in size.
  5. Encrypted Field cannot be type cast as Unique or External ID.
  6. An encrypted field cannot be configured with a default value.
  7. You can’t use encrypted fields in report filters and list views.
  8. You can’t use the encrypted fields in SOQL “where/order” clauses.
  9. Also we can not use encrypted field formula fields, workflow rules, workflow field updates, approval process entry criteria, and approval step criteria.
  10. If you clone a record that has encrypted custom fields, Salesforce will copy the data from the field ONLY if the user has the “view encrypted data” permission.
  11. You can access the data of encrypted field in apex, i.e value is always unmasked.

18. Record owner changes,What happens to the manually shared records?

Ex: X is the owner of Record 1 --Manually Sharing --> With Y

        Salesforce Admin changes the Record 1 owner to Z.So what happens to 

      Changing the owner of a record automatically removes all shares from it.This is the  standard behavior.

Salesforce FAQ Post1
Salesforce Advanced FAQ2


Thursday, 21 December 2017

Salesforce FAQ's

1. What is the return type of SOSL queries ?

List<List<SObject>>,Because it will give result from multiple objects

2. How can we schedule apex program ?

Implement a class with 'Schedulable' interface.
Then using 2 options able to schedule.
1.Apex class --> Schedule Apex 
2. Using System.schedule - Cron expression


3. What is the use of Database class in Apex?

Apex offers two ways to perform DML operations: using DML statements or Database class methods.
 Use Database class methods if you want to allow partial success of a bulk DML operation
—if a record fails, the remainder of the DML operation can still succeed.

4. What is analytical snapshot?

Analytical snapshot is also called as "Reporting Snapshot".

Its available on Tabular & Summary reports.

Reporting snapshots allow users to run reports and save the report results as records on custom objects. Unlike reports, users can schedule reporting snapshots to summarize data at specific times, and work with the summarized data similarly to how they work with other records in Salesforce.

Implementation:
Create a Tabular/Summary Report. 
Create a custom object to with the fields of above report & Map those to get the result of report into custom object.
This can be scheduled.



5. How can you setup governor limit email warnings in apex ?

  • APEX warning mails, which are sent when a class or trigger exceeds 50% of an APEX governor limit

Set up Apex exception email notifications


6.When do we need to use Javascript remoting and how is it implemented?

Jacascript Remoting :
JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page.

Annotation :
@RemoteAction - 

When to Use ?
JavaScript remoting is optimized for use on mobile pages and on pages that use third-party JavaScript libraries. It enables dynamic, interactive pages that feel more responsive than traditional Visualforce pages.

You can load only the initial page and the data that you need to display the page, and then lazily load additional data that might not be used on the page immediately. 


7.There is a master-detail relationship between two objects and I want to ensure that the master object should not have more than 10 child records. How can we achieve this without using a trigger ?


Roll-Up Summary - Refer



8. What should be done to override the governor limit that restricts you from fetching more than 50,000 records in a SOQL query ?

Batch Apex can be used ,That process 50 million records

9.Suppose there are 2 Account records with 3 contacts associated against each Account record. What would be the end result, if I merge these two Account records ?

The final Account will have 6 contacts [3+3]




10. A custom field is made Read only from the Field level security and Required from Page layout. The Field will be ?Read Only for the User  (or) Required for the User  ?

Read Only for the User

Note: Field level security overrides the page layout settings

11.What are the different types of attributes that can be added to a lightning component?

12.What is the difference between application level events and component level events in lightning ?

13.What is the use of the tag in Lightning ?

14.How can two components who are not related to each other, interact with each other in lightning ?

Using Application Events.

15.What is the difference between pageblocktable and datatable in VF pages ?

16.What is the use of the ‘transient’ keyword ?
Use the transient keyword to declare instance variables that can't be saved, and shouldn't be transmitted as part of the view state for a Visualforce page.
17.What is the use of communities in Salesforce ?

18.Skinny Tables in salesforce ?

19.What are dynamic SOQL queries and how do you prevent SOQL injection in dynamic SOQL queries ?

20.What is apex managed sharing ?

21.What is the difference between approval process and workflow rules ?

22.What is the use of apex email services ?

23.Best way to page design for more number of fields(500) in salesforce ?

24.What is the difference between REST & SOAP ?

25. How to take design decision if service is exposed to both REST & SOAP ?

26.Explain end to end connecting for Inbound & Outbound ?

27.How to restrict the action of external request ?

28.What is connected App?

29. How to get the data captured in excel from different vendors to Salesforce ?