In-depth Interview Questions on Salesforce Objects and Relationship

 

Q. Can we set owner field on detail object?

The Owner field on the detail object is not available and is automatically set to the owner of its associated master record.

Q. Can we do allow re-parenting in master detail relationship by default?

By default, records can’t be reparented in master-detail relationships. Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in the master-detail relationship definition.

Q. Can standard object be on the detail side of relationship with custom object?

Standard object cannot be on the detail side of a relationship with a custom object.

Q. For which standard objects we can have master detail relationship?

We cannot create a master-detail relationship in which the User or Lead objects are the master.

Q. What is affect of primary master object on junction object?

  • Look and feel: The junction object’s detail and edit pages use the color and any associated icon of the primary master object.
  • Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
  • Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.

Q What happens if you delete primary master-detail or convert it to lookup in many -many?

If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.

Q. Can we have lookup relationship from master to junction object for many to many relationships?

Yes

Q. Can we convert master-detail into lookup relationship?

You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.

Q. When we convert master-detail relationship to lookup of custom object on detail side, what happens to OWD of that object?

Converting a master-detail relationship to a lookup for a custom object on the “detail” side, changes the organization-wide default for the object to public read/write.

Q. Can we convert lookup to master detail relationship?

You can convert a lookup relationship to a master-detail relationship if the lookup field in all the records contains a value.

Q. When we convert lookup to master-detail relationship of custom object on detail side, what happens to OWD of that object?

Converting a lookup to a master-detail-relationship changes the organization-wide default to Controlled by Parent and the sharing model is updated to public read/write.

Q.Explain Self-Relationships?

You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can’t be linked to itself. However, a record can indirectly relate to itself.

For example, the Holiday Promotion campaign can have the Direct Mail campaign selected in the lookup relationship, and the Direct Mail campaign can have the Holiday Promotion campaign selected in the lookup relationship.

Q.What are the considerations for multilevel master detail relationship?

To create multilevel master-detail relationships, you need the “Customize Application” user permission.

You can have up to three custom detail levels.

 

An object can appear once in multilevel master-detail relationships.

Multilevel master-detail relationships do not support division transfers.

You can use multilevel master-detail relationships in custom report types.

Custom report types created for multilevel master-detail relationships count towards the organizations custom report type limit and no reports are generated if this limit is exceeded.

Q. If custom object already contains the data then how can we establish master detail relationship?

You can’t create a master-detail relationship if the custom object already contains data. You can, however, create the relationship as a lookup and then convert it to master-detail if the lookup field in all records contains a value.

Q.Can custom junction object become master in multilevel master-detail relationship?

 

Custom junction object can’t become the master object in a multilevel master-detail relationship.

Q. Can we delete custom object on the master side of master-detail relationship?

You can’t delete a custom object if it is on the master side of a master-detail relationship.

Q. What happens if we delete custom object on the detail side of master-detail relationship?

If you delete a custom object that is on the detail side of a master-detail relationship, the relationship is converted to a lookup relationship.

 

Deleting a detail record moves it to the Recycle Bin and leaves the master record intact

Q. If you delete a detail record and later delete the master record in master-detail relationship. Later, you undelete the master record then what happens?

If you delete a detail record and later, separately, delete its master record, you cannot undelete the detail record, as it no longer has a master record to relate to.

 

Q. What happens when either of master object is deleted in many to many relationships?

Junction object records are deleted when either associated master record is deleted and placed in the Recycle Bin.

If both associated master records are deleted, the junction object record is deleted permanently and can’t be restored.

Q. In many to many relationships which master object controls the sharing of junction object?

Sharing access to a junction object record is determined by a user’s sharing access to both associated master records and the Sharing Setting option on the relationship field.

Q. What happens when we try to delete parent record if there are more than 200 junction objects associated to it?

In a many-to-many relationship, a user can’t delete a parent record if there are more than 200 junction object records associated with it

if the junction object has a roll-up summary field that rolls up to the other parent. To delete this object, manually delete junction object records until the count is fewer than 200.

Q. Can we create roll-up summary on secondary master on many to many relationship?

Roll-up summary fields that summarize data from the junction object can be created on both master objects.

You can define Apex triggers on both master objects and the junction object.

Q. Can junction object be on master side of any master-detail relationship?

A junction object can’t be on the master side of another master-detail relationship.

Q What are considerations while deleting a parent?

Deleting a record that has child records isn’t allowed, except when the child records are soft-deleted (sent to the Recycle Bin). If all the child records of a parent record are soft-deleted, then the parent record is deleted. Furthermore, any soft-deleted children are then removed from the recycle bin and permanently deleted.

Q. In the scenario where field A is the target lookup of field B, which in turn is the target lookup of field C, you can specify that A can delete B, but B cannot be deleted because it’s in a relationship with C. If you try deleting A, what will happen?

If you try to delete A, you’ll get an error saying that B can’t be deleted because it’s linked to C.

 

Q. If parent record in lookup relationship is deleted then what shows in the field history tracking of child record?

If the parent record in a lookup relationship is deleted, the field history tracking for the child record does not record the deletion. For example, if a parent account is deleted, the Account History related list for the child account does not show the deletion.

Q. What type of relationship are supported by external objects?

Only lookup, external lookup, and indirect lookup relationships are available for external objects. No other relationship types are supported.

 

Q. Is cascade -delete available in external objects?

Cascade-delete isn’t available for external object relationships.

Q. What happens to custom reports when Converting a relationship from lookup to master-detail or vice versa?

Converting a relationship from lookup to master-detail or vice versa can cause existing custom reports to become unusable due to the different standard report types available for each type of relationship.

We recommend that you test your custom reports immediately after converting the relationship type. If you revert your relationship back to the original type, the reports are restored and become usable again.

Q.Is there any standard object which is also act as junction object ?

Yes, there are some standard objects which acts as a junction object.

For Example, Standard object OpportunityContactRole is acts as junction object between Opportunity and Contact objects.

Q.What are external objects?

External Objects are similar to custom objects in salesforce, But external object record data is stored outside your salesforce Organization. The Data Stored in external systems like Oracle, SAP, Heroku Postgres etc. Each external object is associated with an external data source definition in your Salesforce organization. An external data source specifies how to access an external system.

  • Each org can have up to 100 external objects. External objects don’t count toward the amount for custom objects.

By Using External Objects, You don’t have to manage a copy of that data in Salesforce, so you’re not wasting storage and resources keeping data in sync and you can access data on demand.

External objects are best used when you have a large amount of data that you can’t or don’t want to store in your Salesforce organization, and you need to use only a small amount of data at any one time.

every External object ends with “__x“.

EXAMPLE

If you sync the provider org’s Account object, the subscriber org creates:

  • An external object with the API name Account__x
  • Custom fields including one with the API name Name__c

If you sync the provider org’s CustObj__c object, the subscriber org creates:

  • An external object with the API name CustObj_c__x
  • Custom fields including one with the API name Name__c

If the provider org’s object has a custom field, the subscriber org creates the custom field on the equivalent external object, for example:

  • MyCustField_c__c
  • MyOtherCustField_c__c

If you sync the provider org’s Account__x external object, the subscriber org creates:

  • An external object with the API name Account_x__x
  • Custom fields including one with API name Name_c__c

External objects are available with Salesforce Connect and Files Connect. Each external object is associated with an external data source definition in your Salesforce organization.

Q. What is external data source?

An external data source specifies how to access an external system. Salesforce Connect uses external data sources to access data that’s stored outside your Salesforce organization.

Files Connect uses external data sources to access third-party content systems. External data sources have associated external objects, which your users and the Lightning Platform use to interact with the external data and content.

By accessing record data on demand, external objects always reflect the current state of the external data. You don’t have to manage a copy of that data in Salesforce, so you’re not wasting storage and resources keeping data in sync.

External objects are best used when you have a large amount of data that you can’t or don’t want to store in your Salesforce organization, and you need to use only a small amount of data at any one time.

 

Q. What is external lookup?

An external lookup relationship links a child standard, custom, or external object to a parent external object.

The values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.

External object record detail page with standard object Account related list and external object Sales_Order related list

 

Q. What is indirect lookup?

An indirect lookup relationship links a child external object to a parent standard or custom object. When you create an indirect lookup relationship field on an external object, you specify the parent object field and the child object field to match against each other.

Q. What is big object?

A big object stores and manages massive amounts of data on the Salesforce platform. You can archive data from other objects or bring massive datasets from outside systems into a big object to get a full view of your customers. Clients and external systems use a standard set of APIs to access big object data. A big object provides consistent performance, whether you have 1 million records, 100 million, or even 1 billion. This scale gives a big object its power and defines its features.

Q.What are types of big object?

There are two types of big objects.

  • Standard big objects—Objects defined by Salesforce and included in Salesforce products.  Standard big objects are available out of the box and cannot be customized.
  • Custom big objects—New objects that you create to store information unique to your org. For example, if you’re building an app to track product inventory, create a custom big object called HistoricalInventoryLevels to track historical inventory levels for analysis and future optimizations

Q. What are some Custom Big Object Use Cases?

  • 360° view of the customer—Extend your Salesforce data model to include detailed information from loyalty programs, feeds, clicks, billing and provisioning information, and more.
  • Auditing and tracking—Track and maintain a long-term view of Salesforce or product usage for analysis or compliance purposes.
  • Historical archive—Maintain access to historical data for analysis or compliance purposes while optimizing the performance of your core CRM or Lightning Platform applications.

Q. What is differences Between Big Objects and Other Objects?

Because a big object can store data on an unlimited scale, it has different characteristics than other objects, like sObjects. Big objects are also stored in a different part of the Lightning Platform.

Big Objects sObjects
Horizontally scalable distributed database Relational database
Non-transactional database Transactional database
Hundreds of millions or even billions of records Millions of records
  • Big objects support only object and field permissions, not regular or standard sharing rules.
  • Features like triggers, flows, processes, and the Salesforce mobile app are not supported on big objects.
  1. What are type of big objects?
  • Standard big Objects: These are defined by salesforce and included in salesforce products. Ex : FieldHistoryArchive(Which allows you to store upto 10 years of archived field history data)
  • Custom Big Objects: You cannot create big objects through Standard Salesforce UI. However you can create big objects by following two ways.
  1. By using Metadata API: Custom Big Objects are defined and deployed by you through metadata api. To define a custom big object, you create an object file that contains its definition, fields, and index, along with a permission set to define the permissions for each field, and a package file to define the contents of the object metadata. After inserting metadata file through workbench you can check the Big Object API Name ends with “__b” in org.
  2. Custom Big Object Creator: There is another way to create Big Object is, by installing “Custom Big Object Creator” managed package from Salesforce Labs. We can create Big object using Custom Big object creator lightning tab. In Big Objects OWD, CRUD, Field level security can be set as per requirement. As these objects are using for storage so it will support only 5 data types which are “Text, Long Text Area, DateTime, Number and Look Up
  1. How can I insert records to Big Objects?

There are different ways to create BigObject record, like using a csv file, use APIs like Bulk API or even Async SOQL or database.insertImmediate(record) apex method

Using REST API:

You can insert the data into the object by using rest api post method through work bench:

“/Service/Data/v40.0/sObjects/CustomObjHistory__b”

You can expose the data by using visual force page or lightning component.

Q.How can We Query Big Objects?

If we know that you are querying small amount of records then you can use SOQL

And the another way is “Async SOQL

AsyncSOQL: To manage millions and millions of records in your custom big objects salesforce introduced AsyncSOQL. But Async SOQL is included only with the licensing of additional big object capacity

Q.What are some Big Objects Considerations?

  • You can create only 100 big objects per org. The limits for big object fields are similar to the limits on custom objects, and depend on your org’s license type.
  • Big Objects supports only Object and Field level security
  • Big Objects can be used in Einstein analytics but not for report builder and search.
  • We cannot track field history in Big Objects
  • Big Objects don’t support transactions that include big objects, standard objects, and custom objects.
  • You cannot write triggers, flows, processes on big objects.
  • You cannot use Salesforce Connect external objects to access big objects in another org.
  • The best practice when writing to a big object is to have a retry mechanism. (For example Retry the batch until you get a successful result from the API or Apex method)
  • You can delete the data in Big Objects using “deleteImmediate()” apex method.

Q. When to use Salesforce Connect?

  1. When Real time access to latest data : Both systems keep in sync with real time data
  2. When the external system is reliable : When the external system is , System of Record and almost maintenance free
  3. Two way CRUD operation: To sync the data between 2 systems w.r.t Create/Update/Delete
  4. When external system have millions of data : When you are integrating other system to Salesforce and you don’t need to replicate Substantial amount of data.

Q.What are some Consideration Related to External object?

  • The Extrenal data is not stored in salesforce and it will be accessed when we run the repor
  • When you run a report , salesforce performs a request call out to external Object
  • Historical trend Reporting and Buckets and Bucket fields not supported in External Object reports
  • If the report includes summary fields and formulas, those aggregate values reflect only a subset of your data. To improve the accuracy of the aggregate values, try customizing the report to obtain more relevant data
  • The Report can fetch up to 2000 records if it has a child objects the total records may be greater or lessthan 2000 based on how many child records fetched.
  • Formula and Roll-up Summary fields not supported.
  • Field History tracking not supported.
  • Notes and Attachment not supported.
  • External object Metadata is external system driven.
  • Do not support Salesforce Automations.

10,000 OData callouts per hour for Enterprise, Performance, and Unlimited Editions.

Q.What is Salesforce connect?

Salesforce Connect is a standard salesforce framework that enables you to create, view, edit, delete and search the data outside salesforce(external sources), whether on-premise  or cloud, or from salesforce

To get access to the real time data stored in external system need to create External Data Source in salesforce

Setup -> External Data Source -> New External data Source

Q.What will happen if we undelete junction object and normal object from recycle bin?

Master – Detail Relationship data types will be converted to look up relationship data types.

If we undelete any object from recycle bin, then all master detail relationship will be changed to lookup relationship.

Q.What are the default indexed fields in Salesforce? 

We have some fields which are indexed by default in Salesforce, which are :

  • Name
  • ID
  • Owner fields
  • Master-detail relationship fields
  • Lookup fields
  • Last modified dates
  • Audit dates

Q. What are setup objects?

Setup objects are those which interacts with metadata All other object (Standard and Custom) are non setup object.

Did you enjoy this article?
Signup today and receive free updates straight in your inbox.
I agree to have my personal information transfered to MailChimp ( more information )
50% LikesVS
50% Dislikes