Data Modeling and Management Flashcards
The system administrator of an organization has been given the task of creating a custom application in Salesforce with a number of custom objects and fields. The admin is looking for the most efficient way to set up the data model for the application.
The Schema Builder can be used to efficiently create custom objects, fields, and relationships using a single user interface. It allows viewing how the different objects are related to one another which can be useful to understand how the data model should be setup
A real estate company needs to store information about properties as well as sales deals in Salesforce.
Information about properties can be stored by creating custom objects which can be named ‘Property’. Sales deals can be stored using the standard ‘Opportunity’ object.
An organization needs to relate every employee in the company to a salary plan such that each employee can have one or more salary plans that are deleted when the employee leaves.
A master-detail relationship field can be created on the ‘Salary Plan’ (detail) object to the ‘Employee’ (master) object. Deleting an employee record would delete related salary plan.
A recruiting application should consist of candidates and positions such that each candidate can apply for multiple positions and each position can have multiple candidates.
A many-to-many relationship with ‘Candidate’ and ‘Position’ objects as the masters with a junction objects sitting between them that represents the detail side for both.
Users of a non-profit school should be able to select a contact record on the ‘Alumnus’ object that has been created to store alumni. The contact would represent the mentor of an alumnus, but the field should be optional.
Look up relationship to Contact can be created on the ‘Alumnus’ object. The lookup relationship field can be made optional on the Alumnus page layout.
Each user’s record should allow specifying the name of the manager’s manager
A hierarchal relationship field can be created on the User object to relate a user to another user.
Which relationship tightly couples security and deletion between objects
Master-Detail relationship
Which relationship allows for independent security and deletion between objects?
Lookup Relationship
What are the two external types of relationships?
Indirect Lookup
External Lookup
What is an Indirect Lookup?
- Links a child external object with a parent standard or custom object in Salesforce
- the parent object field and the child object field are specified to match and associate records in the relationship
- a custom unique, external ID field on the parent object is selected to match against the child’s indirect lookup relationship field whose values come from an external data source
What is an External Lookup?
- Links a child standard, custom or external object with a parent external object.
- the standard External ID field on the parent external object is matched against the values of the child’s external lookup relationship field
- external object field values come from an external data source
What are the 6 relationship types available?
- Lookup
- Master-detail
- Many-to-many
- External Lookup
- Indirect Lookup
- Hierarchal
What are some implications of external and indirect lookups?
- only lookup, external lookup, and indirect lookup are available for external objects
- the loading of related lists of child external objects could be impacted if the external systems availability is impacted
- Lookup searches are not available for both external and indirect lookups. However, the field can be edited and the external ID from the external system can be entered
- In reporting, cross filters are not supported for external object relationships
- Bucket fields and historical trend reporting are not supported for external objects.
What are fields that can’t be changed?
-Standard Fields
-Custom fields using ‘Shield Platform Encryption’
-Custom fields mapped for lead conversion
-Fields referenced by setup items, such as:
+Visualforce page
+Apex
+Process Builder
+Flows
How do you change a field’s data type?
Change Field Type button after editing the field
What is the best practice for changing a field’s type
- Only changing fields that have no data, so there’s no risk of data loss
- Backing up data ahead of the change
What fields will cause data loss by changing TO them from all others?
- to Number from any type
- to Percent from any type
- to Currency from any type
Is it possible to convert a Master-Detail relationships to Lookup relationship?
Yes, this can be done BUT not if a roll-up summary field has been defined.
- Waiting page for large records
- *Changing master-detail to lookup on the detail side causes the OWD to be Public Read/Write
Is it possible convert a Lookup relationship to Master-Detail?
Yes, only if there are values for all records though (no null values)
- Waiting page for large records
- *Changing lookup to a master-detail causes OWD to be Controlled by Parent.
Is it possible to convert a custom field to ‘Encrypted’ type? Or vice versa?
No
No
What is the difference between Classic Encryption and Shield Platform Encryption?
Classic:
-Included in base license
-Features masking for (***) for sensitive data
-Can only encrypt custom fields up to 175 chars
-Cannot be used in workflows and formula fields
-128-bit AES
Shield Platform:
-There is additional cost
-Does not provide masking, must use field-level security
-offers higher level of encryption (256-bit AES)
-Can encrypt standard, custom, files and attachments
-does not work with certain 3rd party apps
What are some fields that can’t be encrypted?
- Fields on external data objects
- Fields that are used in an account contact relation
What are restrictions on changing AutoNumber fields?
Good Conversions: -Auto Number to Text -Text to AutoNumber (less than 30 chars Bad Conversions: -Auto-Number to anything not Text
What are restrictions on changing Formula fields?
No conversions allowed, this field is read-only. It cannot be converted to or from Formula type.
What are restrictions on changing picklists?
Good Conversions:
- custom picklist to custom checkboxes. The values map to checked boxes and unchecked boxes representing the other options can be chosen
- custom picklist to multi-select picklist. The value maps to the matching option as selected but leaves other options that can be selected.
What are restrictions on changing relationships?
Good Conversions:
-Can convert relationship to non-relationship type (and vice versa) ONLY on external objects
What are restrictions on changing Text Area (Long)?
Good Conversions:
- Phone
- Text
- Text Area
- URL
- Data is truncated to first 255 chars
What are restrictions on changing Text Area (Rich)?
Good Conversions:
- Can only convert to Text Area (Long).
- Images are deleted the next time long text area field is saved
- *the markup is hidden until the record is saved under the new type, in case it needs to be restored.
What field conversion can cause an external ID to no longer act as one?
If you change the data type of a custom field that is set as an external ID, choosing a data type other than text, number, or email causes the field to no longer act as an external ID.
What are restrictions for changing FROM Number field?
Good Conversions: -Currency -Email -Percent -Phone -Text -Text Area -Text Area (Long) -URL Conversion, but total data loss: -Checkbox -Date -Date/Time -Picklist -Multi-Select Picklist
Can you convert Picklist to Multi-select picklist? If so, what are the caveats?
Yes, but only defined picklist values are retained. Any inactive picklist values are lost.
Can you convert Picklist to Checkbox?
Yes, and it’s possible to map picklist values, but it may result in unrecoverable data loss. If two or more picklist values are mapped to same checkbox value they will be indistinguishable.
Can you convert Picklist to Text?
Yes, with no issues
Can you convert Picklist to other besides Text?
Yes, but all data will be lost.
What conversion is allowed from Text to X but all data will be lost?
- Checkbox
- Currency
- Date
- Number
- Percent
Can you convert from Text to Multi-Select Picklist?
Yes, but all data will be lost. Data can be retained if the field is first converted into a Picklist.
Can you convert from Text to Picklist?
Yes, all unique values from records will autopopulate as dropdown options during conversion process.
What fields will cause data loss changing FROM to anything else?
- Changing from AutoNumber to any other type
- Changing from Picklist Multi-Select to any other type
- Changing from Checkbox to any other type
- Changing from Date or Date/Time
What field type cannot have default values set?
- AutoNumber
- Formula
- Roll-Up Summary
- Lookup Relationship
- External Lookup relationship
- Geolocation
- Multi-select picklist
- Time
What are 4 key features you can set on a custom field?
- Default value
- Unique
- Required
- Case Sensitive
What are the 3 read only fields
- Auto Number
- Formula Field (not allowed on external objects)
- Roll-Up Summary Field (COUNT, SUM, MIN, MAX)
What are the limits of a Text field?
- can be a combo of alpha numeric chars
- can specify an exact length between 1 to 255 chars
What are the limits of a Text Area field?
- Upto 255 alpha numeric
- chars can be entered on different lines
- length cannot be specifed
What are the limits of a Text Area (Long)?
- Can specify length between 256 and 131,072 chars
- visible lines set between 2 and 50
What are the limits of a Text Area (Rich)?
- Can specify length between 256 and 131,072
- visible lines set between 10 and 50
- can contain HTML formatting and images
What are the features of a Text (Encrypted) fields?
-175 chars max
-alphanumeric and symbols stored using Classic encryption
-field is masked (* or X) unless user has ‘View Encrypted Data’ system permission
-Various mask types exist:
+All
+Last Four
+Credit Card
+National Insurance Number
+SSN
+Social Insurance Number
- Can be validated using validation rules or Apex
-Cannot be used as a filter (list views, reports, roll-ups)
-Using this field requires ‘Require secure connections (HTTPS)’ enabled
-no field type conversions to or from
What are the return types (output type) that can be chosen for a formula field?
- Checkbox
- Currency
- Date
- Date/Time
- Number
- Percent
- Text
- Time
What is a restricted picklist?
Only values defined can be used, not even the API can insert new ones
*Global Value Sets are always restricted