Question 81
An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.
What is the optimal way to implement this?
What is the optimal way to implement this?
Question 82
trigger AssignOwnerByRegion on Account ( before insert, before update )
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region__c theRegion = [
SELECT Id, Name, Region Manager__c
FROM Region__c
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account's region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region__c theRegion = [
SELECT Id, Name, Region Manager__c
FROM Region__c
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account's region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)
Question 83
Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users.
Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business.
One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?
Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business.
One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?
Question 84
1 Contact con = new Contact( LastName ='Smith', Department = 'Admin')
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?
Question 85
What is the transaction limit for SOQL queries?