Developer Fundamentals Flashcards
How can a developer check if the current user is able to delete the current object?
Choose 1 answer.
A. Use the is Deletable() method of the DescribeSObjectResult Class
B. Use the Deletable() method of the SObjectResult Class
C. Use the canDelete() method of the SObjectResult Class
X D. Use the canDelete() method of the DescribeSObjectResult Class
✔️ A. Use the is Deletable() method of the DescribeSObjectResult Class
The isDeletable() method of the DescribeSObjectResult class returns true if the object can be deleted by the current user, and false if otherwise. The class contains several other methods that can be used to determine other types of permissions of the current user such as isAccessible(), isCreateable, isSearchable(), and more.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
Which of the following events are fired when an Aura component loads on a page?
Choose 3 answers.
A. init
B. render
C. load
D. after Render
E. start
✔️A. init
✔️ B. render
✔️ D. after Render
The ‘init’ event signals that a component initialization is complete. The ‘render’ event triggers the start of component rendering. The ‘after Render’ event signals that the rendering is complete. At this point, one can interact with the DOM tree to do additional processing.
The ‘load’ and ‘start’ options are not alid terms used to describe events in the rendering lifecycle of an Aura component.
Objective: Developer Fundamentals
Detailed Objective: Understand multi-tenant concepts and design frameworks, such as MVC architecture and Lightning Component Framework.
A company has a business requirement that cannot be met using the declarative tools available in its Salesforce org. As a result, the Salesforce Administrator of the company has resorted to installing a suitable package available in the AppExchange marketplace. What are the benefits of using AppExchange?
Choose 2 answers.
A. AppExchange can scan an org for any security vulnerabilities.
B. AppExchange apps may include support and maintenance.
C. AppExchange offers reviewed and proven solutions for customers.
D. AppExchange installs additional development tools in the org.
✔️B. AppExchange apps may include support and maintenance.
✔️C. AppExchange offers reviewed and proven solutions for customers.
Salesforce AppExchange is a marketplace for downloading solutions such as apps and components for the Salesforce platform. It has both free and paid solutions, which may include support and maintenance.
The AppExchange platform is used for installing an already built solution instead of additional development tools for building the solution. It is not used for scanning security vulnerabilities.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, identify common use cases and best practices for declarative versus programmatic customizations, including governor limits, formula fields, and roll-up summaries.
Cosmic Lux is a company that uses Salesforce as the primary system to manage accounts. An ERP system is currently used to manage contact records of customers in Europe. The sales director of the company would like to store only the accounts associated with these contacts in Salesforce. To make the related contacts visible in Salesforce, Salesforce Connect should be used. The contacts in the ERP system have not been configured to store the Salesforce ID of the parent account record. A developer has been asked to show all the related contacts from the external system on the account detail page in Salesforce. Once Salesforce Connect has been configured, which relationship field should the developer define on the external object for this requirement?
Choose 1 answer.
A. Indirect Lookup
B. Internal Lookup
C. External Lookup
D. Lookup
✔️A. Indirect Lookup
An indirect lookup relationship field can be used to link a child external object to a parent standard or custom object in Salesforce, such as the Account object. A custom unique, external ID field on the parent Account object can be selected to match against the child’s indirect lookup relationship field, whose values are determined by the specified External Column Name. Since the external system does not contain unique record identifiers for the account records from Salesforce, a custom External ID field needs to be used. That is why using an indirect lookup relationship is the only way of meeting this requirement.
A lookup relationship can only be used for this use case if the external object includes a column that identifies related Salesforce records by their 18-character IDs. An external lookup relationship links a child standard, custom, or external object to a parent external object. In this case, it is necessary to link a child external object to a parent standard object, so an external lookup relationship cannot be used. There is no relationship field called ‘Internal Lookup.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
Se puede utilizar un campo de relación de búsqueda indirecta para vincular un objeto externo secundario a un objeto estándar o personalizado principal en Salesforce, como el objeto Cuenta. Se puede seleccionar un campo de ID externo personalizado y único en el objeto Cuenta principal para que coincida con el campo de relación de búsqueda indirecta del secundario, cuyos valores están determinados por el Nombre de columna externa especificado. Dado que el sistema externo no contiene identificadores de registro únicos para los registros de cuenta de Salesforce, se debe utilizar un campo de ID externo personalizado. Por eso, utilizar una relación de búsqueda indirecta es la única forma de cumplir con este requisito.
Una relación de búsqueda solo se puede utilizar para este caso de uso si el objeto externo incluye una columna que identifica registros de Salesforce relacionados por sus ID de 18 caracteres. Una relación de búsqueda externa vincula un objeto externo, personalizado o estándar secundario a un objeto externo principal. En este caso, es necesario vincular un objeto externo secundario a un objeto estándar principal, por lo que no se puede utilizar una relación de búsqueda externa. No existe ningún campo de relación denominado “Búsqueda interna”.
Objetivo: Fundamentos del desarrollador
Objetivo detallado: Dado un escenario, determinar, crear y acceder al modelo de datos apropiado, incluidos objetos, campos, relaciones e identificaciones externas.
Cosmic Transport would like to use the Lightning Component Framework for adding functionality that allows the company’s users to manage its transportation services. A developer has been asked to work on a few custom Lightning web components that will be added to Lightning pages and tabs. Which of the following is an important consideration for this use case?
Choose 1 answer.
A. The Lightning Component Framework allows only Aura components to be added to Lightning tabs.
B. My Domain needs to be deployed in order to add the components to Lightning pages and tabs.
C. Each Lightning web compoñent bundle must contain at least a controller and a CSS file.
D. Each Lightning web component must be wrapped in an Aura component before it can be added.
Choose 1 answer.
✔️B. My Domain needs to be deployed in order to add the components to Lightning pages and tabs.
The Lightning Component Framework allows both Aura components and Lightning web components to be added to Lightning pages and tabs. However, My Domain needs to be deployed first before the components can be added to Lightning tabs, Lightning pages, as standalone apps, as actions and action overrides, as custom Lightning page templates, or elsewhere in the org.
Each Lightning web component that renders Ul consists of an HTML file, a JavaScript file (controller), and a metadata configuration file. A Lightning web component does not need to be contained in an Aura component for it to be added to a page or as a tab.
Objective: Developer Fundamentals
Detailed Objective: Understand multi-tenant concepts and design frameworks, such as MVC architecture and Lightning Component Framework.
A construction company in the housing development business uses the Contact object to track different types of contacts they deal with on a daily basis. The company’s Salesforce developer is building a feature for its partner contacts and has written the code below to determine information about a specific record type. Which line of code should be added to line 5?
- RecordType recType [SELECT Id, Name FROM RecordType
- WHERE Sobject Types “Contact” AND DeveloperName=”PartnerContact’
- LIMIT 1];
- Schema. DescribeSObjectResult result Schema.SObjectType.Contact;
5. - Schema, RecordTypeInfo recordTypeInfo mapRecTypes.get(recType.id);
Choose 1 answer.
A. Map Id, Schema.RecordTypeInfo> mapRecTypes result.getRecordTypeInfos();
B.Map<Id, Schema. RecordTypeInfo> mapRecTypes result.getRecordTypeInfosById();
C. MapeId, Schema. RecordTypeInfo> mapRecTypes result.getRecordTypes();
B.Map<Id, Schema. RecordTypeInfo> mapRecTypes result.getRecordTypeInfosById();
To return a map of the record ids and details of their associated record types, the getRecordTypeInfosById() method of the Schema DescribeSObjectResult class can be used. The data type used to store the results of this method is a map collection in which the key is an id and the value is the Schema. Record TypeInfo class.
A The ‘getRecord TypeInfos’ method returns a list of the record types, but since line 6 contains code that uses the get() method, a method that returns a map should be used. There are no methods called getRecord Types’ and ‘getRecordTypelds
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
RecordType rectType = [SELECT Id, Name, DeveloperName FROM RecordType WHERE SobjectType = 'Contact' Limit 1]; Schema.DescribeSObjectResult result = Schema.SObjectType.Contact; Map<Id, Schema.RecordTypeInfo> mapRecTypes = result.getRecordTypeInfosById(); Schema.RecordTypeInfo recordTypeInfo = mapRecTypes.get(rectType.Id); System.debug('RecordTypeInfo Name: ' + recordTypeInfo.getName()); System.debug('RecordTypeInfo DeveloperName: ' + recordTypeInfo.getDeveloperName());
How can a developer check if a user has read access to a field and if the field can be displayed on a Visualforce page?
Choose 1 answer.
A Call the is Accessible() method of Schema. DescribeFieldResult to verify field level read permission
B. Call the IsAccessible() method of Schema. DescribeSObjectResult to verify field level read permission
C. Call the is Readable() method of Schema SObjectResult to verify field level read permission
D. Call the isViewable() method of Schema. DescribeField Result to verify field level read permission
✔️A Call the is Accessible() method of Schema. DescribeFieldResult to verify field level read permission
The is Accessible() method of Schema. Describe FieldResult class can be used to determine if the current user has read access to a specific field.
The isAccessible() method on the Schema.DescribeSObjectResult class is used to determine if the current user has access to a specific object. The isViewable() and is Readable() methods do not exist
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
A developer has declared and initialized a variable named ‘s’ of type String[] to store multiple sObject types. He uses the code below to get describe metadata information for the sObject types.
Schema. DescribeSobjectResult[] r = Schema.describeSObjects(s):
Which method of the DescribeSObjectResult class can be used to determine whether an sObject appears as ‘Account’ in the user interface?
A. getName()
B. isLabel()
C. isName()
D. getLabel()
✔️D. getLabel()
The getLabel() method of the DescribeSObjectResult class returns the object’s label, which may or may not match the object name.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
To determine whether an sObject appears as ‘Account’ in the user interface, you can use the getLabel() method of the DescribeSObjectResult class. This method returns the display name of the sObject as it appears in the user interface.
Here is how you can use it:
apex
Copiar código
Schema.DescribeSObjectResult[] r = Schema.describeSObjects(s);
for (Schema.DescribeSObjectResult dr : r) {
if (dr.getLabel() == ‘Account’) {
// This sObject appears as ‘Account’ in the UI
}
}
In this example, the getLabel() method checks if the sObject’s label matches “Account”. If it does, it means that this sObject appears as “Account” in the user interface.
What is true regarding the Salesforce multitenant environment?
Choose 2 answers.
A. All customizations are specified as metadata, allowing for easy upgrades
B. All customers share the same code base, but have their own database
C. Metadata includes configuration but not code
D. Automatic upgrades are applied during the year according to the Salesforce release schedule to all customers
Choose 2 answers.
✔️A. All customizations are specified as metadata, allowing for easy upgrades
✔️D. Automatic upgrades are applied during the year according to the Salesforce release schedule to all customers
All standard and custom configurations, functionality, and code in an org are metadata. These customizations are separated in a special metadata layer, so upgrades can easily be performed. These uprcades are released automatically three times a year for all customers.
In Salesforce’s multitenant environment, users share the same code base and database. Hence, governor limits are strictly imposed.
Objective: Developer Fundamentals
Detailed Objective: Understand multi-tenant concepts and design frameworks, such as MVC architecture and Lightning Component Framework.
How can a developer check the maximum number of digits for an integer field?
Choose 1 answer.
A. Use the getLength() method of the DescribeField Result Class
B. Use the getSize() method of the DescribeField Result Class
C Use the getDigits() method of the DescribeFieldResult Class
D. Use the getScale() method of the DescribeField Result Class
✔️C Use the getDigits() method of the DescribeFieldResult Class
The getDigits() method returns the maximum number of digits specified for the field. This method is only valid with Integer fields.
The getScale() method returns the number of digits to the right of the decimal point on Double fields.
The getSize() method does not exist in the DescribeField Result class.
The getLength() method returns the maximum size of the field in Unicode characters.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
Cosmic Solutions has a custom object called Weekly Employee Summary, which stores a summary of employee data that is tracked in Salesforce, such as hours worked and wage totals. An autolaunched flow has been built to calculate this information and create a new Weekly Employee Summary record for each employee every time it is run. Currently, a Salesforce Administrator needs to run this flow manually once a week. They would like this type of operation to be run automatically in the future. Which solutions would meet this requirement?
Choose 2 answers
A. Invoke the flow from a schedule-triggered flow.
B. Invoke the flow from an Apex job that runs weekly.
C. Configure the flow on the ‘Scheduled Jobs’ page in Setup.
D. Use an existing Process Builder process to run the flow weekly.
✔️A. Invoke the flow from a schedule-triggered flow.
✔️B. Invoke the flow from an Apex job that runs weekly.
A declarative solution is to invoke the autolaunched flow from a schedule-triggered flow using the Subflow element in Flow Builder. Schedule-triggered flows can be configured to start on a specified date and time, with several frequency options. The scheduling configuration is available on the flow’s Start element. The Subflow element is added that references the autolaunched flow to invoke.
A programmatic solution is to invoke the flow from an Apex class that implements the Schedulable interface, which enables the Apex class to run on a scheduled basis. To invoke a flow from Apex, the Flow.Interview class is used.
Process Builder cannot be used to invoke autolaunched flows in scheduled intervals or timings. An auto-launched flow cannot be configured on the ‘Scheduled Jobs’ page in Setup.
Cosmic Solutionsm uses a third party platform for managing their employees’ compensation plans. It needs to be integrated with its Salesforce org. For example, when the third party platform sends a request for a particular resource to the org, the org should respond to the request by serxding data in JSON format. In addition, when certain records are changed.in the ong, the third party platform should be automatically notified of the change. Which of the following should be used to meet the requirement?
Choose 2 Answers
A. Bulk API
B. Streaming API
C. SOAP API
D. REST API
B. Streaming API
D. REST API
Both REST API and SOAP API can be used to integrate a Salesforce org with an external system. However, while REST API supports both XML, and 150 data formats, SOAP API only supports XML Streaming API which uses the publish subscribe model, is used for setting up notifications that can be triggered when record changes are made in the Salesforce org. For example the external system can subscribe to a platform event in the org and receive a notification when a specific data change occurs hulk Aptuned for loading or deleting large sets of data in the org.
Olajective: Developer Fundamentals
Detailed Objective: Understand multi-tenant concepts and design frameworks, such as MVC architecture and Lightning Component Framework
A developer is required to ensure that a reason is entered if an opportunity stage is updated to ‘Closed Lost. What is the best way to meet this requirement?
Choose 1 answer.
A. Required field
B. Apex trigger
C. Validation rule
D. Formula field
C. Validation rule
A validation rule can be used to check both the stage and reason fields of an opportunity during the update. If the stage is set to ‘Closed Lost’ and the reason field is empty, then the validation rule can display the wror message.
The requirement can be met using a declarative tool, so there is no need to use an Apex trigger. A formula field is used for displaying values, for example, based on data from the current record or related records. Setting the field to ‘Required’ will require that field to be always populated regardless of the opportunity stage.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, identify common use cases and best practices for declarative versus programmatic customizations, including governor limits, formula fields. and roll-up summaries.
Phone Factory uses a custom object named Phone Inventory which has a Geolocation field named Storage Location. A developer is writing a trigger that needs to update Storage Location when certain conditions are met. What is the proper syntax for accessing and modifying this field in Apex?
Choose 1 answer.
A. Phone_Inventory_c.Storage_Location_c.latitude_s AND/OR Phone_Inventory_c.Storage_Location_c.longitude_s
B. Phone_Inventory_c.Storage_Location_c.latitude AND/OR Phone_Inventory_c.Storage_Location_c.longitude
C. Phone_Inventory_c.Storage_Location_latitude_s AND/OR Phone_Inventory_c.Storage_Location_longitude_s
D. Phone_Inventory_c.Storage_Location_c
✔️ C. Phone_Inventory_c.Storage_Location_latitude_s AND/OR Phone_Inventory_c.Storage_Location_longitude_s
Geolocation is a compound data type and can’t be directly accessed. To modify a Geolocation field’s data, remove the ‘_c’ from the field name and append ‘_latitude_s’ or ‘_longitude_s’ to access the relevant components.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
Which of the following correctly describes how the Salesforce platform features map to the MVC software design pattern?
Choose 1 answer.
A. Model: JavaScript; View: Visualforce Pages; Controller: Custom Apex Class
B. Model: Standard and Custom Objects; View: JavaScript, Controller: Standard and Custom Controllers
C. Model: Apex Classes; View: Pages and Components; Controller: Standard and Custom Objects
D. Model: Standard and Custom Objects; View: Pages and Components; Controller: Standard and Custom Controllers
D. Model: Standard and Custom Objects; View: Pages and Components; Controller: Standard and Custom Controllers
The ‘Model’ component in the MVC pattern represents data structure, which is defined using standard and custom objects in Salesforce. The ‘View’ component comprises pages and components, such as Visualforce pages and Lightning components.
The ‘Controller’ includes any custom controller logic written in Apex and standard controllers containing standard behavior for each object implemented by the Salesforce platform.
The ‘Controller’ may also represent JavaScript code in the form of a client-side controller.
Objective: Developer Fundamentals
What is true regarding accessing sharing programmatically?
Choose 3 answers.
A. Objects on the detail side of a master-detail relationship do not have a sharing object
B. Programmatic sharing can only give record access to one individual user at a time
C. CustomObject_Share is the sharing object for a custom object
D. Account__Share is the sharing object for the Account object
E. AccountShare is the sharing object for the Account object
✔️A. Objects on the detail side of a master-detail relationship do not have a sharing object.
✔️C. CustomObject__Share is the sharing object for a custom object
✔️E. AccountShare is the sharing object for the Account object
To access sharing programmatically, the sharing object associated with the standard or custom object should be used.
To determine the name of the share object associated with a standard object, the suffix “Share” is added to its name. For example, the share objects for the Account, Case, and Contact objects are AccountShare, CaseShare, and ContactShare respectively. As for custom objects, the “__Share” suffix is used instead. For example, the sharing object for MyCustomObject (or MyCustomObject__c) is MyCustomObject__Share.
Objects on the detail side of a master-detail relationship do not have an associated sharing object, and access to the detail records is determined by the master object sharing object and the sharing setting of the relationship.
Record access can be granted to users or groups with programmatic sharing.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
A developer would like to return the developer name of a particular record type using a method of the ‘RecordTypeInfo’ class. Which method is available for this use case?
Choose 1 answer.
A. getDeveloper Name()
B. getRecordTypeInfos By Developer Name()
C. getName()
D. getRecord TypeInfosByName()
✔️ A. getDeveloper Name()
The getDeveloperName() method of the Record TypeInfo class can be used to return the developer name of a particular record type. The getName() method returns the Ul label of a record type. Both getRecordTypeInfos By DeveloperName() and getRecord TypeInfosByName() are methods of the DescribeSObjectResult class. The former is used to return a map that matches developer osByD names to their associated record type. The latter is used to return a map that matches record labels to their associated record type.
Objective: Developer Fundamentals
Detailed Objective: Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.
There is a requirement to rate all accounts daily based on the values of the opportunities closed in the current year, the number of open opportunities, and the opportunity close rates. The account with the highest aggregated result should be rated number 1, and so on until the account with the lowest rating is updated. How could this requirement be achieved?
Choose 1 answer.
A. Use an Apex trigger on the Account object and schedule it to run each night.
B. Use a Batch Apex job and schedule it to run each night.
C. Use a platform event-triggered flow to run scheduled nightly updates.
D. Use Process Builder and schedule an action to run each night to sort and rate accounts.
✔️B. Use a Batch Apex job and schedule it to run each night.
Processes or triggers cannot be configured to run periodically at fixed timings or intervals. A scheduled Apex job would be suitable for this requirement since it can be scheduled to run at regular intervals and is very capable of performing the required logic. Platform event-triggered flows cannot be scheduled. A scheduled flow may also be used in the above scenario, but if the logic is too complex, Apex should be used. Furthermore, batch Apex has much higher governor limits compared to scheduled flows.
A batch Apex job can be used to process all the account records daily. An Apex class that implements the ‘Database.Batchable’ interface can be created for the batch Apex job. Another Apex class
that implements the ‘Schedulable’ interface can be created to execute the batch Apex job at regular intervals.
The ‘Schedule Apex’ page in the Salesforce user interface or the ‘System.schedule’ method can be used to specify the schedule. The Apex class defined for the batch Apex job must use the following syntax:
A sales user needs to track customer preferences and product interests. Which of the following options falls under the Model layer of Salesforce’s MVC architecture?
Choose 1 answer.
A. Creating a custom field
B. Creating a Visualforce page
C. Defining a page layout
D. Defining an Apex controller
✔️A. Creating a custom field
In Salesforce, a data model is built by creating custom fields, custom objects, etc. The data model falls under the ‘Model’ layer of the MVC architecture. The other options fall under the “View’ and ‘Controller layers.
Objective: Developer Fundamentals
Detailed Objective: Understand multi-tenant concepts and design frameworks, such as MVC architecture and Lightning Component Framework.