Data loading is a very common requirement in most of the
salesforce projects. We need to load many master data and transactional data in
production based on requirements that include thousands of records. In this article, I am going to list some best practices that we can follow and keep in mind
while loading data in production.
1.
Organization-Wide Sharing defaults -
While loading data in production,
if objects have ‘Private’ OWD then it does additional processing in the background.
Therefore, it is better to load data using read/write OWD and change it to ‘private’
after cutover.
2.
Workflow rules, validation rules, and triggers -
If these tools are enabled in your
production org while loading data, it can give many errors and it may slow down
the process. Therefore, it is recommended to disable these tools before loading
data.
3.
Bulk API Vs. SOAP API -
SOAP API is useful for small data sets
where complex processing is required, but it is time-consuming for large data
sets. Bulk API is designed to process from thousands to millions of records. It
is based on REST principles and makes data loading faster.
4.
Pre-Processing data for production -
It is important to invest time in
data analyzing and preparing before cutover activities. If we are disabling
workflow rules/validation rules/ triggers for data load, we need to make sure
the data we are loading is correct and meeting the criteria of automated tools mentioned
above. We may need to query data and use excel functionality to make sure data
is correct.
5.
Use custom setting to disable triggers -
If you have numbers of triggers in
org then it is difficult to disable and enable each one of them, also sometimes
we may forget to enable a few triggers after data load. Therefore, as a best practice,
we can create a checkbox field in a custom setting to decide if triggers should
run, and we need to add this flag in each trigger.
6.
Post-activity -
Once data loading is completed
make sure you perform all required activities, some examples are below –
·
Enable custom setting for triggers.
·
Enable workflow rules / validation rules /
process builders.
·
Change OWD to private if needed.
·
Update existing record with bulk API / Batch
jobs if needed.
While performing activities to speed up data processing, keep
below points in mind.
·
Record owners should exist in org before loading
data.
· Make sure owners have correct role hierarchy assigned
to do processing of data while loading.

Great Article
ReplyDeleteAtocloud Blog - Stay Updated with Latest Salesforce Information
Excellent read, Positive site, I have read a few of the articles on your website now, and I really like your style.
ReplyDeleteThanks a million and please keep up the effective work and also get to know about Salesforce Sales Cloud Consultant