Salesforce Interview Questions-Data Modelling

Data Modelling(Salesforce) Interview  Questions-

1.       What is an app in Salesforce

Answer: An App in Salesforce is nothing but a container containing the app’s name, a logo, and a set of ordered tabs. Or An app is a group of tabs that work as a unit to provide functionality
Remember, all the metadata, such as your objects, apex classes, triggers, etc., have nothing to do with an app.
App just allows you to group all the things that help you achieve a flow.You can customize existing apps to match the way you work, or build new apps by grouping standard and custom tabs.

Navigation to create app in Sales force: Setup ->Build ->Create->App-> Click on new and create your application according to your requirements.
For example, the Sales app(Standard application ) Contains a tab for the object that is part of Sales flow like Account, Contact, Opportunity, Lead, Order, etc.

2.      What is the difference between Standard and Custom objects?Answer: Standard objects which are default set in with Salesforce. Examples are Account, Contact, Lead, and Opportunity.

Custom objects are when you create information that’s specific to the industry. For example, your business may want to create a custom property object which will store all the information related to real estate that you want to sell.

3.      What are the different types of object relationships available in Salesforce?

Answer: We have two types of relationship in Salesforce, namely:
Master-Detail(1:n Relationship):
It’s a tightly coupled relationship that allows you to connect one object to another.Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.


·         Up to 2 allowed to object.

·         Parent field on child is required.

·         Deleting parent automatically deletes child.

·         A child of one master detail relationship cannot be the parent of another.

·         Dependent fields will inherit the owner, sharing and security settings from its master

·         can define master-detail relationships between two custom objects, or between a custom object and standard object as long as the standard object is the master in the relationship.

·         Lookup field on page layout is required.


Lookup(1:n Relationship):
Its a loosely coupled relationship that allows you to connect one object to another.
Look up relationship is something like “has-a” (Containership) relationship. Where one record has reference to other records. When one record is deleted then there is no impact on other records.




·         Up to 25 allowed for object

·         Parent is not a required field.

·         No impact on a security and access.

·         No impact on deletion.

·         Can be multiple layers deep.

·         Lookup field is not required.

Self Relationship:

Object creation from a relationship is possible, but it must be a lookup relationship. Parent account field on Account that allows us to choose an account as a parent account of an existing one.

for example, we  have a Campaign. This campaign is part of a bigger campaign. You This would be a great situation to show how multiple child campaigns relate to the main parent campaign

Hierarchical Relationship:
This unique relationship can only be used on the user object and is designed to create a hierarchy of users.  Use a lookup field to associate users. It does not indirectly or directly points to itself. One can create a custom hierarchical relationship field to store every user’s direct manager.
Many to Many Relationship(Junction Object):
Many to many relationship can exist when there is a need to create two master-detail relationships. Two master-detail relationships can be created by linking 3 custom objects. Here, two objects will be master objects and the third object will be dependent on both the objects. it will be a child object for both the master objects.

External Lookup Relationship:
An external lookup can link a custom, external, or a child standard object to a parent external object. It also allows a relationship to be created between two external objects. The external id field on the external object is matched against the value of the external lookup relationship field.

Indirect Lookup Relationship:
Indirect lookup relationships are used to link a child external object to a parent custom or standard object.  When creating a new indirect lookup, you must create a lookup field on the external object. Then you must specify the parent object field and the child object field so that they can be matched against each other.

 4.      What is Many – to – Many relationship?

Answer: Lookup and Master detail relationships are one to many relationships. We can create many – to –Many relationship by using junction object. Junction object is a custom object with two master detail relationships.

 5.      Can we stop users from deleting the record using a validation rule?

Answer: No, we cannot. 

6.      Can we create Master details relationship on Custom object if custom object contains existing records.

Answer: No, directly we cannot create master details relationship if custom object contains existing records.

7.      Is it possible to fire a validation rule only when a record is being inserted and not being updated?

Answer: Yes, we can use the keyword ISNEW() to restrict validation to fire only in case of insertion.

 8.      Can we rollup summary field from Contact to Account?

Answer: No, we can’t as contacts are not in a master-detail relationship with accounts. It’s a special relationship that allows cascade delete, but contacts can also exist without an account.

9.      Can a standard object be on the detail side of a relationship?
Answer: No

10.   Can I convert a lookup relationship to master detail?
Answer: Yes, you can only if either all the records have values populated for the parent object or there are no records at all.

11.    Can we convert the master-detail relationship to lookup?
Answer: Yes, if there are no rollup summaries defined on a parent object

12.   Can I use formula fields as filter criteria while defining rollup summaries fields?
Answer: No

13 Does a change in rollup summary fields also fire trigger?
Ans: Yes

14.   What is a schema builder?
Answer: Schema Builder provides a dynamic environment for viewing, modifying all the objects and relationships in-app. It dramatically simplifies the task of designing, implementing, and changing your data model or schema. Schema Builder is enabled by default.

15.   Can you change the value formula field on the record?
Answer: No formula fields are read-only fields.

16.   What is a dependent picklist?
Answer: Dependent picklist becomes active once a value is chosen on a controlling field.

We can map a value or set of values allowed for a particular value on a controlling field.

For example, When choosing your location, you first select a country, then depending on your country, the second picklist, i.e., the state, gets enabled, then depending on your state, you choose your city.

17.   What fields can be made dependent?
Answer: Custom picklist, Multi-Picklist can be marked as dependent fields.

18.   What is the difference between ISNULL and ISBLANK?
Answer: ISBLANK has the same functionality as ISNULL but also supports text fields as text fields are never null; hence using ISNULL on text fields would always return false while is blank returns T or F depending on if the field is empty or not.

19.   Can we convert formula fields into any other data type?
Answer: No, it’s not allowed.

20.  Can we mark standard fields as dependent fields?
Answer: No

21.   Can we define checkbox and multi-select fields as controlling fields?
Answer: No, we can’t define multi-select as the controlling field, but we can define the checkbox as the controlling field.



Post a Comment