Unique and external ID fields

When adding fields, you can indicate whether the values stored within them are unique and/or external identifiers. For unique fields, the platform will automatically enforce this rule regardless of how records are created or updated, rejecting records with no unique values. By utilizing fields designated as external ID fields, you can simplify the data loading process for users; this will be discussed later in this chapter in more detail. Both of these field modifiers result in a custom index being created, which can help optimize query performance.

You can help users avoid creating duplicate records with the same name by ensuring that other identifying fields such as these are also added to the lookup layout, as described in the previous chapter.

Let's add Unique and External Id fields to record the driver's Twitter handle. Perform the following steps in the packaging org to try this out:

  1. Create a new Text field, Twitter Handle (TwitterHandle__c), with a length of 15 on the Driver object, and check the Unique and External Id checkboxes.
  2. Utilize the Driver records entered in the previous chapters to update the fields and confirm that the system prevents duplicate Twitter handles. Lewis Hamilton's Twitter handle is LewisHamilton, and Ruben's is rubarrichello.
  3. Update the permission sets that have read and write permissions for the new field to Race Management, and read-only permissions to Race Analytics.

By following the preceding steps, you have ensured that there can be no duplicate records that have the same value in the Twitter Handle field. In the next section, you can see how using Auto Number fields can provide a unique numbering system for records.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.147.124