Interface Scenarios Flashcards
(3 cards)
The customer service department receives emails from their website users containing attachments such as images or documents. A multiple-step process is involved where the agents have to manually download and then upload the attachments to the related cases in their org. The department is asking if there is a way to improve the process.
An Apex class can be built that extends the Messaging.InboundEmailHandler interface. This enables the class to handle inbound email messages and store the contents and attachments of an email message in an object called InboundEmail. Having access to this object through the class enables automating the upload process by retrieving any email attachment and uploading to the related case such that it skips the entire manual work.
A Salesforce org over the years has accumulated a number of old records that can already be deleted. The head of operations is asking the Salesforce developer to design and set up a maintenance routine for the org which needs to be run automatically on a periodical basis from this point onwards.
To achieve this requirement, an Apex class in the form of a scheduled job can be run to delete records that meet criteria and handle other necessary procedures involved in the maintenance process. To schedule an Apex to run at predefined intervals, it can implement the Schedulable interface. After which, it can then be scheduled in the Scheduled Jobs page in Setup, or programmatically using the System.schedule method.
A multi-national company manages an org with millions of records and hundreds of users who access the platform on a daily basis. The Salesforce administrator needs to run a process for opportunity records in the org. It will assess and identify what needs to be done to the record such as to archive or keep the record, reassign to another user, or update certain fields such as type, close dates, etc.
To avoid hitting governor limits, Batch Apex can be used to run the process. It is capable of processing thousands or even millions of records. Every transaction in batch Apex starts with a new set of governor limits. Also, when a batch transaction fails, all the other successful batch transactions will not be rolled back. Batch Apex is an Apex class that implements the Database.Batchable interface.