The first lesson we learned in the book was that Force.com is a relational object oriented database. Let us revisit the objects that we saw in the first chapter of the book. In the general library system we have the following relationships:
The object Customer is related to Media through a junction object CustomerMedia. Media object is a master for books and video objects as shown in the following diagram:
As shown in the following diagram, Fine has a Lookup on Cards:
Finally, as shown in the following diagram Card has a Master-Detail lookup on Customer:
When we load data we have to load in the order of dependencies, for example, in the library system the CustomerMedia object is dependent on the Customer and Media object.
Hence, to load the CustomerMedia object we use the following sequence:
The rule of thumb when uploading the data is that every dependent object data should be loaded first. As the CustomerMedia object had two dependencies, one on Customer object and another on Media object, we loaded both the data first.
When we are loading legacy data into the Salesforce system during migration it is sometimes essential to change the Created Date, Last Modified Date, Last Modified by, and Created by entries. Normally, when we load data into the system, the dates are not modifiable and are system time stamped.
However, Salesforce.com provides us with the facility for modifying the auditing fields only once during the first insert. This is helpful in migrating legacy data and preserving history.
To enable this feature we need to contact Salesforce customer support.
Some of the important features of modifiable system fields are as follows: