Data Modeling

 

Data Modeling

 1.What is CRM?                                                                                                                              Ans: CRM stands for Customer Relationship Management. This technology allows you to manage  relationships with your customers and prospects and track data related to all of your interactions. It also helps teams collaborate, both internally and externally. It can communicate via email, Phone, social, and other channels. In Salesforce, all of this information is stored securely in the cloud.

2.What is Salesforce?                                                                                                                                      Ans: Salesforce is a customer success platform, designed to help you sell, service, market, analyze, and connect with your customers.

  • Salesforce has everything to run our business from anywhere. Using standard products and features, you can manage relationships with prospects and customers.
  • Salesforce is a cloud based CRM application. It is number one platform as a service.
  • Force.com is the platform used to build Salesforce application.

Note: Salesforce organizes our data in the form of Objects and Records

3.What is an Object in Salesforce?

Ans:In Salesforce an Object is a database table which stores data specific to the organization. Table means we have rows and columns.

  • In Salesforce Columns are called Fields and  rows are called Data or Record.
We have different types of Objects in Salesforce.
  1. Standard Objects: Objects which are already provided by Salesforce are called Standard Objects.   Ex:Account, Contact, Lead, Opportunity.
  •  We can not delete Standard Object, we can only Rename them. 
      2.Custom Objects: Objects which are created by administrators or by us are called Custom Objects.
             Ex:My Custom Object__c.
  • We Can do anything to the custom object like Delete, Rename.
Note:We can identify an Object is Standard or Custom by using their API Name, Custom object API Name ends with __C(Double underscore'C'). Simply remember 'C' means Custom. But Standard object API name never ends with __C.

       3.External Objects: External objects are similar to custom objects. They allow you to map the data              stored outside of  our Salesforce organization using Salesforce Connect. 

        Eg:  you may have data stored in enterprise resource planning(ERP)system. You can access these data, in real time, in salesforce through external objects using Salesforce Connect. External objects are usually identified by a__x. suffix.

4.What is field in Salesforce?

Ans: As we already discussed a field is nothing but a Column in database table. In Salesforce  we have two types of fields 

1.Standard Fields: The fields which are already provided by salesforce are called Standard fields.

  • Id
  • Is deleted
  • Name
  • Created Date
  • Created By Id
  • Last Modified Date
  • Last Modified By Id
  • SystemModeStamp
  • LastViewedDate
  • LastReferencedDate          

The above mentioned fields are Standard fields defaultly provied by Salesforce.

We can not delete and rename to the Standard fields. This fields are used for auditing purpose.

2.Custom Fields:The fields which we can create for our purpose are called Custom Fields.
  • We can delete and rename to custom fields.
Note: We can differenciate whether it is standard or custom field by using their API Name. Similarly as a Custom object, Custom field name also ends with __c(double Underscore__c). Standard fields never ends with __c.

  • In Standard objects we can create custom fields.
  • If we create an object by default some fields will be provided by salesforce those are Standard Fields , and we can also create Custom fieds in Custom Objects. 
5.What is Data type in salesforce?
Ans:Data type means the type of the data which we are going to store into the field.

  • Relationship Fields : Lookup Relationship, Master-Detail Relationship, External-Lookup Relation.
  • Read Only fields:Auto Number, Formula Fields, Roll-Up Summary.
  • Checkbox
  • Currency
  • Date
  • DateTime
  • Email
  • Number
  • Phone
  • Percentage 
  • Picklist
  • PickList(Multi-Select)
  • Text
  • TextArea
  • TextArea(Long)
  • TextArea(Encrypted)
  • Time
  • URL
6.What is Auto Number?
Ans:Auto Number is the field whose values are generated by the system.
  • It generates the numbers in sequential manner and in specific format with starting number
  • This is Read Only Field we can not set values for numbers.
  • It will be edited only at the time of creation.
  • While creating Auto Number we have one checkbox called Generate Auto Number for existing records. If we check that checkbox then it will generate number for existing records also.
7.What is Formula Field?
Ans:Formula fields are the fields whose values are calculated using formula 
  • This is Read Only Field we can not set value to the field.
  • The value of the field will be calculated based on the given formula whenever the record is quired or displayed to the end user
  • The value in formula fields are not stored in Database
  • Data types available in formula fields are Checkbox, Currency, Date, Date/Time, Number,Percent,Text,Time
8.What is Roll-Up Summary field?
Ans:Roll-up Summary field is used to perform aggregate functions like Count,Sum,Minimum and Maximum.
  • The value of the field will be updated automatically whenever the child record is created or updated.
  • This is Read Only Field.
  • Roll-up Summary Field is enabled only on Master in Master-Detail Relationship.
  • We can create upto 25 Rollup Summary fields.
Formula fields calculate values using fields within a single record,  but roll-up summary fields calculate values from a set of related records, such as those are in related list.

9. What is a Tab in Salesforce?
Ans: A Tab is like a user interface that is used to build records for objects and to view the records in the objects. We have different types of Tabs.
  • Custom Object Tab
  • Web tab
  • Visualforce Tab
  • Lightning Components Tab
  • Lightning page Tab
Custom tabs let you dispaly custom object data or other web content in Salesforce.

10.What is an App ?
Ans: An app in Salesforce is a set of objects, fields, and other functionality that supports a business process. we can see which app you're using and switch between apps using the App Launcher(App Launcher icon).

Group of items that work together to serve a particular functionality is termed as App.
  • An App can contain custom object, tabs, PageLayout etc.
  • We have two types of apps Salesforce Classic App and Salesforce Lightning App.
11.What is Field Dependency?
Ans: Field Dependency means controlling a fields value based on the other field.
  • We have two types of fields in field dependency  1.Controlling Field 2. Dependent field
Controlling Field: Controlling field is a type of picklist field that controls what values will become available on it's designated dependent fields.
  • Controlling field should be a Picklist or Checkbox
  • Dependent field should be a Picklist or Picklist(Multi-Select).
  • We can use any custom or standard picklist with less than 300 values, or any checkbox field witin a single record as a controlling field.
  • Picklist can have 1000 values but a controlling picklist can have only 300 values.
  • Standard Picklist(given by salesforce) always be a controlling field.
12.What is History tracking?
Ans: History tracking shows the history of field, such as who changed the field and what type of field is changed.
  • If we need to track the history of fields we should enable Track Field History at the time of creating object
  • If the field value is more than 255 characters the previous and current values can not be tracked just shows as edited.
  • Formula fields, Auto Number fields, Rollup Summary fields,Created by Id for such type of fields we can't track history.
  • We can not track history to the Textarea and  Multi Select just shows as edited.
  • Maximum number of fields enabled for Tracking History is 20
13.What is difference between Lookup and Master detail Relationship?
Ans: Relationship means linking the data between two objects

Lookup Relationship:A Lookup Relationship essentially  links two objects together, so that you can "Look up" one object from the related item on another object.
  • You can create Lookup relation even if the records exist in the object
  • Field is not mandatory 
  • If you delete parent, child will not be deleted but the value of the field becomes empty.
  • Rollup summary field is not allowed because field is not mandatory.
  • We can create upto 38 to 40 relationships.
  • It is not controlled by Parent.
Master-Detail Relationship:
  • We can not create M-D relationship if the records are already exist in the object.
  • Field is Mandatory.
  • If you delete Parent, child will automatically deleted
  • Rollup Summary fields are allowed
  • Only 2 M-D relationships are allowed per object.
  • It is controlled by parent.
  • Cascading Undelete.
Self  Relationship: Self-Relationship is a Lookup relation to the same object.

14.What is Record Type in Salesforce?
Ans:Record types are used to differentiate the data in the same object. Differentiation is used to deal with customers in different way.
  • Record types are also used to assign the different page layouts to different Record types.
  • We can assign different picklist values to different Record types.
  • We have to create page layouts for Record types.
  • we can't delete or edit the record type for an object if that object is referenced in Apex.

15. What is Page layout in Salesforce?
Ans: Page layout is the user interface which is used to display the data to user.
  • In Page layouts we can make the fields " Required" or "read only".
  • We can reorganize the fields like adding the fields and removing the fields.
  • We can also add blank spaces and can create separate sections.
  • We can assign different pagelayout to different record types.
  • We can organize custom links and custom buttons in page layouts.
16.What is Search layout?
Ans:Search layout is used to display the searched data in diffferent ways. "Allow searching" is enabled at object level, then only the Search Layouts will be available on the object layout.
There are different types search layouts available for objects.

  • Search Results: This search layout determines the fields that are displayed when we do global search.
  • Lookup Dialogue: This layout defines the fields that are displayed after you do search from a lookup dialogue.
  • Object Tab: Tab search searchLayout determines the fields that are displayed on searched home tab for recently viewed, created or modified records.
  • Search Filter fields: This layout determines the fields that are available to filter search results.
    • If you search for any record in global search then it will display more number of records, if you want to filter that records then use search filter fields.
Note: Search layouts can be customized for custom objects in the same way as standard objects. we can add upto 10 fields, but can not remove identifying fields such as account or case number.

17.What is Validation Rule? 

Ans: Validation rule is a way to validating the data whether the entered data is correct as per organization rule.

  • Simply we can say validation rule is the way of enforcing the user to enter the correct data into database.
  • Validation rule throws an error message if the user enter the data, that is not specified to that rule.
We can use the below functions in validation rules to validate the rule. These functions are also used in Workflows , Process Builder, Lookup Filter.

I am mentioning onlw few functions. You please go through all the functions.

AND(Condition1,Condition2,.........,Condition n)

It returns true if all the conditions are true, if any one condition is false it returns false.

OR(Logic1,Logic2,........., Logicn)

It returns true if any one of condition is true, and it returns false when all the conditions are false.

IF(LogicalTest, Value if true, Value if false)

It evaluates the expression on two cases of True/False.

INCLUDES(multi-select picklist field, text literal)

It is used to evaluate whether the given value is available selected values in the multi select or not.

ISBLANK(Expression)

Checks whether an expression is blank and returns true or false. It is uesd to check the values of text fields, email and text area fields.

ISCHANGED(field)

Checks if the field's value is different from it's prior value and returns true if the value differ, otherwise returns false.

ISNULL (Expression)

Checks whether an expression is null and returns true or false. Mainly it is used to evaluate if the field is having  a value or not. It used for fields like Date, Number, Phone, Relationship etc.

ISPICKVAL(Picklist field, text literal)

It is used to check the picklist value. It returns true if the selected value is "text literal".  

LEN(Text) 

Returns number of characters in a text string

PRIORVALUE(field)

It returns the previous value of the field. 

BEGINS(Text, Compare text)

It is used to compare a string whether a string starting with a given string or not.

CONTAINS(Text, Compare text)

It returns true if the text contains the compare text else returns false.

NOT(logical)

It returns false if the logical returns true.

 TODAY()

Returns the current date

TEXT(Value)

It converts given value into text using standard format. It uses to check picklist values etc. 

VALUE(Text)

It converts a text string that represents a number to a number. 

18.What is workflow?

Ans: Workflow is an automated business process which executes whenever the record is created or edited. 

We have 4 types of actions in Workflow

  • Email alert
  • Field update
  • Task creation
  • Outbond message 
* There are two ways of executing the above four actions
  1. Immediate Workflow actions 
                The actions which will be performed immediately after meeting  the record criteria.
      
      2. Time dependent workflow actions
                 
               The action which will be performed in future based on the any date of the field. To create the time dependent workflow action we should create one time trigger.
                In time trigger we can give either days or hours with the maximum of 999 value and we can select either before or after.

*In workflow we have two types of criteria
  1. Evaluation Criteria

Evaluation criteria explains when the workflow is to be executed.

    • Again in Evaluation criteria  we have 3 types.
    1. Created

 If the Evaluation criteria is "Created", whenever the new record is created at that time only the workflow will executes.

                2.Created and everytime it's edited

If you select this criteria, whenever the record is created or edited it will be executed.

 * How many times you will edit that many times it will execute.

               3.Created, and anytime it's edited to subsequently meet criteria

* If you select this criteria whenever the record is created it will executes

* It will not execute TRUE to FALSE and TRUE to TRUE, executes only when FALSE to         TRUE(means when criteria become false stage to true stage then only it executes).

     2. Rule Criteria

It is nothing but a condition, if the condition is true then only the workflow will be fired.

*About Field update action

  We can update field of same object an we can update field only in master in M-D Relationship.

             We can not update field in Lookup Relationship.

             We can not update child record. 

* we can add 10 time triggers for workflow

Workflow Scenario

We have a "Time based workflow" and there is action scheduled to be executed, if we deactivate the workflow, scheduled actions will be removed from queue or not?

Ans: Even after deactivating the workflow, its actions will not be removed. it will be active in queue.


We have time based workflow and there is action to be executed, can we delete that workflow?

Ans: It is not possible to delete the workflow, when the workflow is having any pending time dependent actions.

When we can not add time dependent action in workflow rule?

  • when workflow rule is active
  • when workflow rule is deactivated and has pending actions in the queue.
  • when the evaluation criteria is created and every time its edited.
What is Re-evaluate Workflow Rules after Field Change in Field update action?
Ans:  Whenever we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update of  workflow rule, due to this field update other workflow rules on the same object will be fired if the entry criteria of those workflow rules satisfied.

In case, in other workflow rules also if we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update recursive workflow rules will come in some scenarios.

We can take two steps to avoid recursive workflow rules:-

* Choose Workflow Evaluation criteria as Created, and any time it's edited to subsequently meet criteria.
* Don't enable the check box called   Re-evaluate Workflow Rules after Field Change Checkbox in the Field Update of a Workflow Rule.

19.What is Process Builder?
Ans: Process builder is an automated business process which executes whenever the record is created or updated.
  • One process builder is equal to 10 workflows
  • In workflow we have only one criteria but in process builder we have 10 criterias.
  • Process builder works in IF ELSE mode with 10 criterias
  • Only one criteria will be executed once, if one criteria is true it ignores all other criterias.
  • Unlike Workflow we can update child records as well.
We can perform following actions using process builder

    • Calling Apex
    • Creating a record
    • Updating a record
    • Email alerts
    • Calling flows
    • Post to chatter
    • Calling Process
    • Calling Quick Actions
    • Quip
    • Send custom notification
    • Submit a record for approval 
Note: The Process builder can be invoke by another process builder or when a platform event is occured.

* We can not send outbond message through Process builder.
* Workflow and process builder can not be fired when the record is deleted.
*If you want to make any changes(Like Editing) in Process builder , you need to clone the Process              builder  after cloning previous version deactivates and new version activates then you can edit in the new version. 

 20. What is Mini PageLayout?

Ans: Mini Page Layout is a layout defined from the existing "Page layout". It is a subset of units existing in page layout. It is defined to show hover details when you mouse over a field on an object's detail page or in the Recent item section of the sidebar.


No comments: