Data Modeling and Management Flashcards

1
Q

A developer is creating an application to track engines and their parts. An individual part can be used in different types of engines. Which data model should the developer use to track the data and to prevent orphan records?

A. Create a master-detail relationship to represent the one-to-many model of engines to parts.

B. Create a lookup relationship to represent how each part relates to the parent engine object.

C. Create a junction object to relate many engines to many parts through lookup relationships.

D. Create a junction object to relate many engines to many parts through master-detail relationships.

A

D. Create a junction object to relate many engines to many parts through master-detail relationships.

A junction object should be created because an engine has many parts and a component can be part of many engines. A master-detail relationship will prevent orphan records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A company wants a recruiting app and data model for job candidates and interviews, with the following requirements:

  • Display the total number of interviews on each candidate record.
  • Define security on interview records that’s independent from the security on candidate records.

Which two things should a developer do to accomplish this? (Select two answers.)

A. Create a lookup relationship between the Candidate and Interview objects.

B. Create a master-detail relationship between the Candidate and Interview objects.

C. Create a roll-up summary field on the Candidate object that counts interview records.

D. Create a trigger on the Interview object that updates a field on the Candidate object.

A

A. Create a lookup relationship between the Candidate and Interview objects.

D. Create a trigger on the Interview object that updates a field on the Candidate object.

The security of the interview records needs to be defined independently of the candidate, so you must use a lookup relationship. Since you have to use a lookup relationship, you cannot define a rollup summary field and a trigger is needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A developer has the following trigger that fires after insert and creates a child case whenever a new case is created:

List childCases = new List();
for (Case parent : Trigger.new) {
   Case child = new Case (ParentId = parent.Id, Subject = 
      parent.Subject);
   childCases.add(child); 
}
insert childCases;

Which unexpected behavior happens after the code block executes?

A. A child case is created for each parent case in Trigger.new.

B. The trigger enters an infinite loop and eventually fails.

C. Multiple child cases are created for each parent case in Trigger.new.

D. The trigger fails if the Subject field on the parent is blank.

A

B. The trigger enters an infinite loop and eventually fails.

The code sample shows a recursive trigger, caused by the trigger being fired each time a new case is created inside the for loop. This creates an infinite loop and eventually causes the code to fail.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

On which object can an administrator create a roll-up summary field?

A. Any object that is on the master side of a master-detail relationship.

B. Any object that is on the detail side of a master-detail relationship.

C. Any object that is on the parent side of a lookup relationship.

D. Any object that is on the child side of a lookup relationship.

A

A. Any object that is on the master side of a master-detail relationship.

A roll-up summary field is created by showing a value from the master record that comes from field values within the detail record. The detail record should have a master-detail relationship with the master in order to calculate the values from related records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A developer needs to create a new custom object, Invoice, to track customer invoices related to Accounts. How should Invoice and Account be related to ensure that all invoices associated with an Account are visible to anyone with access to the Account?

A. Account should have a lookup relationship to Invoice.

B. Invoice should have a lookup relationship to Account.

C. Account should have a master-detail relationship to Invoice.

D. Invoice should have a master-detail relationship to Account.

A

D. Invoice should have a master-detail relationship to Account.

Sharing for the detail record is inherited from the master record. A master-detail relationship, in which Account is the master and Invoice is the detail, ensures that all associated Invoices for an Account are visible to anyone with access to that Account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A custom field on the Account object was required for prototyping but is no longer needed. Using Schema Builder, what is the correct process for a developer to delete the custom field?

A. Delete the field from Schema Builder and then all references in the code will be removed.

B. Remove all the references in the code and then the field will be removed from Schema Builder.

C. Mark the field for deletion in Schema Builder and then delete it from the declarative UI.

D. Remove all references from the code and then delete the custom field from Schema Builder.

A

D. Remove all references from the code and then delete the custom field from Schema Builder.

Only after deleting the references from the code can you delete the field from Schema Builder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When loading data into an organization, which two actions should a developer take to match the updates to existing records? (Select two answers.)

A. Match an auto-generated Number field to a column in the imported file.

B. Match the Id field to a column in the imported file.

C. Match an External Id text field to a column in the imported file.

D. Match the Name field to a column in the imported file.

A

B. Match the Id field to a column in the imported file.

C. Match an External Id text field to a column in the imported file.

Using the Salesforce ID/External ID makes it easier to update the records so that they are aligned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which three statements are true regarding cross-object formula fields? (Select three answers.)

A. Formula fields can reference fields from master-detail or lookup parent relationships.

B. Formula fields can reference fields in a collection of records from a child relationship.

C. Formula fields can expose data the user does not have access to in a record.

D. Formula fields can reference fields from objects that are up to 10 relationships away.

E. Formula fields can be used in three roll-up summaries per object.

A

A. Formula fields can reference fields from master-detail or lookup parent relationships.

C. Formula fields can expose data the user does not have access to in a record.

D. Formula fields can reference fields from objects that are up to 10 relationships away.

A cross-object formula can reference merge fields from a master (“parent”) object if an object is on the detail side of a master-detail relationship. A cross-object formula also works with lookup relationships.

Formula fields can expose data that the user does not have access to. For example, if you create a formula field on the Case object that references an account field and display that formula field in the Case page layout, users can see this field even if they don’t have access to the account record.

A cross-object formula is available anywhere formulas are used except when creating default values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_Value__c currency field from the CampaignMember object using a roll-up summary field called Total_Estimated_Value__c on Campaign. How is the currency of the Total_Estimated_Value__c roll-up summary field determined?

A. The values in CampaignMember.Estimated_Value__c are converted into the currency on the majority of the CampaignMember records and the sum is displayed using that currency.

B. The values in CampaignMember.Estimated_Value__c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record.

C. The values in CampaignMember.Estimated_Value__c are converted into the currency of the Campaign record, and the sum is displayed using the currency on the Campaign record.

D. The values in CampaignMember.Estimated_Value__c are summed up and the resulting Total_Estimated_Value__c field is displayed as a numeric field on the Campaign record.

A

C. The values in CampaignMember.Estimated_Value__c are converted into the currency of the Campaign record, and the sum is displayed using the currency on the Campaign record.

If your organization uses multiple currencies, the currency of the master record determines the currency of the roll-up summary field. For example, if the master and detail records are in different currencies, the detail record value is converted into the currency of the master record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The sales management team hires a new intern. The intern is not allowed to view opportunities, but needs to see the most recent closed date of all child opportunities when viewing an account record. What should a developer do to meet this requirement?

A. Create a workflow rule on the Opportunity object that updates a field on the parent account.

B. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field.

C. Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field.

D. Create a trigger on the Account object that queries the close date of the most recent opportunities.

A

B. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field.

Fields that users can’t see because of field-level security settings on the detail record are still calculated in a roll-up summary field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

To which primitive data type in Apex is a currency field automatically assigned?

A

Decimal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce. What kind of relationship should a developer use to relate the Account to the Warehouse?

A

Lookup Relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

An administrator needs to get records with locations saved in geolocation or address fields as individual latitude and longitude values. Which SOQL statement accomplishes this goal?

A. SELECT Id, Name, Location__latitude__s, Location__longitude__s FROM CustomObject__c

B. SELECT Id, Name, Location__latitude__c, Location__longitude__c FROM CustomObject__c

C. SELECT Id, Name, Location__r.latitude__c, Location__r.longitude__c FROM CustomObject__c

D. SELECT Id, Name, Location__r.latitude, Location__r.longitude FROM CustomObject__c

A

A. SELECT Id, Name, Location__latitude__s, Location__longitude__s FROM CustomObject__c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

To fulfill a business requirement, a formula field of a child object has been used in a roll-up summary field of a Master object. Will the roll-up summary field function correctly?

A. Yes, using formula fields in a roll-up summary is fully supported

B. Yes, if the formula field is not referring to another field in a different object

C. Yes, if the formula field has a numeric value

D. No, using formula fields in a roll-up summary is not supported.

A

B. Yes, if the formula field is not referring to another field in a different object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A developer would like to relate an external data object (Social Media Posts) to the contacts object in Salesforce to track every post the contact has made in the external platform. How can the developer achieve this?

A. Create an indirect lookup relationship using a custom field with External ID and Unique attributes

B. Create an external lookup relationship using a custom field with External ID and Unique attributes

C. Create a master detail relationship and update the record ID through integration

D. Create a lookup relationship and update the record ID through integration

A

A. Create an indirect lookup relationship using a custom field with External ID and Unique attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which standard objects in the following list are not supported by DML Operations? Choose 2 answers.

A. Profile

B. User

C. Opportunity Line Item

D. Record Type

A

A. Profile

D. Record Type