function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Viraj MViraj M 

Should i create one object or multiple Contact objects in Saleforce?

Hi,

I am new to salesforce..  

I have contacts list from different Datasources, Should i maintain one object for all and add look up relation of different sources OR i maintain different contact object for different sources. I hope maintaining one Object will not be problem(we used to maintain same in SQL DB)... If any limitations then can anyone please let me know

 
jigarshahjigarshah
@Viraj, As per my understanding you are trying to consolidate Contact information within your Salesforce CRM instance which flows in from various data sources and are trying to determine the association between the originating Data Source and Contact.

One of the foremost things I recommend and is also a best practice is to use the standard CRM objects (assuming you are using Sales Cloud) i.e. the Contact object in this scenario to store the Contact information.

There are a couple of ways in which you can define this association between a Contact and its originating Data Source which I have listed below.

Approach # 1 - Using Custom Picklist Fields
This is the simplest approach where you can have a custom field of picklist type, let's say Data_Source__c on the Contact object itself populated with all the Data Source names as the available options. You could have the Data source value, set manually through the User Interface or through automations such as a Workflow Field Update or a Process Builder.

Pros
  • No additional storage consumption since the information is stored on the same Contact record since every Salesforce record consumes only 2 Kb irresective of the number of the columns it contains. This could be an important aspect for consideration since, you are limited by the data storage threshold offered by Salesforce.
  • Simplicity of setup
  • Offers flexibility to build customizations around the same.
  • Reporting of Contact data grouped by Data Source is easy.
Cons
  • You may not be able to associate business processes for e.g. a Sales process wherein you have different teams working on different type of contacts,  efficiently using picklists.
  • If you have an ever growing and changing list of data sources, maintenance is problem. Additionally, custom picklist fields are restricted to a list of 1000 options with each option limited to a maximum of 255 characters.
  • Customization requires additional effort and time.

Approach # 2 - Using Relationships
This approach involves building Data Source as a separate custom object and have it associated with the respective Contact record through a Lookup relationship.

Pros
  • Maintanability of the Data source values become easy since you are not limited by the constraint of 1000 values each being limited to a maximum of 255 characters.
  • Controlling data security such as authorization becomes a lot easier.
Cons
  • You cannot use a Master detail relationship here because Contact being a standard object cannot be a child in the relationsip.
  • You will end up creating additional data source records which would consume an additional 2 Kb of your Salesforce org's transactional storage for every new Data Source record created.
  • Building customizations here would be complex since Workflow field updates do not support updating lookup fields hence you may have to use Apex with a Process Builder or an Apex Trigger to add automation to set the respective data source value.
  • You may not be able to associate business processes for e.g. a Sales process wherein you have different teams working on different type of contacts, efficiently.
  • Reporting would become complex due to relationships.

Approach # 3 - Using ReccordTypes
This approach involves building the originating Data Source as a separate Record Type for every Contact record.

Pros
  • Controlling data security such as authorization becomes a lot easier since RecordType visibility and access can be controlled using Profiles for e.g. you want only certain data source records to be accessed by a limuted set of Salesforce Users.
  • Offers the flexibility of building a business process becomes easy and effficeint.
  • No additional data storage consumption.
Cons
  • Maitainability becomes a challenge since you would need to create and incorporate a new Record Type every time a new Data Source is included. 

I would recommend Approach # 1, to stamp the originating Data source on the Contact record considering you do not require any complex business processes and also need the flexbility of building customizations and are sure that the list of originating data sources will not change. 

Hope this helps.

Please do not forget to mark this thread as SOLVED and the answer as the BEST ANSWER if this helps you resolve your issue.
 
Viraj MViraj M
Thanks for the reply If possible can we have Skype call whenever u r free. I have some more queries.
Viraj MViraj M
What if i maintain different Contacts Objects in salesforce for each Datasources, is there any limitation ?
jigarshahjigarshah
Viraj, Are you referring to creation of different Contact records or different Contact objects for each Datasource? Fundamentally, each Contact will have the same set of information or attributes that need to be tracked hence truly do not see any value in keeping Contact objects separate.

Technically, you do not have a limitation (except that you are limited to creating a max of 200 objects only for an Enterprise Edition org) on creating different objects, but you would end up creating and storing redundant data sets which will add complexity in collating, consolidating and maintenance.

Please do not forget to mark this thread as SOLVED and the answer as the BEST ANSWER if this helps you resolve your issue.
Viraj MViraj M
I have one more question, in SQL we used in one column for lookup id for all the sources and other column source type to identify the source. Can we do samething here, if yes then is there any cons -  one reaon  is we cannot use relationship(datasource__r.Name, datasource__r.Description) to get data of parent object details.

Any going with Look up relationship, i checked max lookup relationship on Custom object is 40.
jigarshahjigarshah
Viraj,

Salesforce provides 2 types of relationship fields to link a record in one Salesforce object with a record in another object. This functions very similarly to the lookup field in SQL.

1. Master Detail
This is a parent child relationship which mandates the existence of a Parent record for creating a child record. An example could be Invoice and Invoice Line Items. This gives you the capability to use Rollup Summary fields that aggregate data from child on the Parent. 

2. Lookup
This is a non mandatory association where the existence of a child is not affected by th existence of the parent. for e.g. Accounts and Contacts.

Traversing fields from a child record to a parent record using relationship fields i.e. fields ending in __r is supported, however, the reverse is not. Refer the following link to understand more about Salesforce object relationships - https://help.salesforce.com/articleView?id=overview_of_custom_object_relationships.htm&type=0  (https://help.salesforce.com/articleView?id=overview_of_custom_object_relationships.htm&type=0)

Considering your scenario of associating Contacts and Data Sources a Lookup field on Contact to identify its Data Source should suffice. 

Please do not forget to mark this thread as SOLVED and the answer as the BEST ANSWER if this helps you resolve your issue.