You have already completed the Test before. Hence you can not start it again.
Test is loading...
You must sign in or sign up to start the Test.
You have to finish following quiz, to start this Test:
Your results are here!! for" Salesforce Certified Platform Developer II Practice Test 8 "
0 of 58 questions answered correctly
Your time:
Time has elapsed
Your Final Score is : 0
You have attempted : 0
Number of Correct Questions : 0 and scored 0
Number of Incorrect Questions : 0 and Negative marks 0
Average score
Your score
Salesforce Certified Platform Developer II
You have attempted: 0
Number of Correct Questions: 0 and scored 0
Number of Incorrect Questions: 0 and Negative marks 0
You can review your answers by clicking on “View Answers” option. Important Note : Open Reference Documentation Links in New Tab (Right Click and Open in New Tab).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Answered
Review
Question 1 of 58
1. Question
Zephyrus Relocation Services (ZRS) wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments containers, based on a Junction object that relates the Contact to the various Account records that represent the departments. Which solution solves these requirements?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 2 of 58
2. Question
Universal Containers (UC) wants to develop a customer community to help their customers log issues with their Containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that its easy to create an international community using Salesforce, and hired a developer to build out the site. What should the developer use to ensure the site is multilingual?
Correct
This is a scenario-based question that is related to the customer community. The scenario given in this question is: The community needs to function for their German- and Spanish-speaking customers. That means, the same community site should show content in a specific language. The ask is: How should the developer use it to ensure the site is multilingual. If your Salesforce org has multiple languages enabled, manage translations so that your global users can use Salesforce in their language. One of the ways is to use Custom Labels. Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a users native language. Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, Lightning Pages, or Lightning components. The values can be translated into any language Salesforce supports. With this explanation, the correct answer is Use Custom Labels to ensure custom messages are translated properly. References: https://help.salesforce.com/s/articleView?id=sf.cl_about.htm&type=5 https://help.salesforce.com/s/articleView?id=sf.workbench_overview.htm&type=5
Incorrect
This is a scenario-based question that is related to the customer community. The scenario given in this question is: The community needs to function for their German- and Spanish-speaking customers. That means, the same community site should show content in a specific language. The ask is: How should the developer use it to ensure the site is multilingual. If your Salesforce org has multiple languages enabled, manage translations so that your global users can use Salesforce in their language. One of the ways is to use Custom Labels. Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a users native language. Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, Lightning Pages, or Lightning components. The values can be translated into any language Salesforce supports. With this explanation, the correct answer is Use Custom Labels to ensure custom messages are translated properly. References: https://help.salesforce.com/s/articleView?id=sf.cl_about.htm&type=5 https://help.salesforce.com/s/articleView?id=sf.workbench_overview.htm&type=5
Unattempted
This is a scenario-based question that is related to the customer community. The scenario given in this question is: The community needs to function for their German- and Spanish-speaking customers. That means, the same community site should show content in a specific language. The ask is: How should the developer use it to ensure the site is multilingual. If your Salesforce org has multiple languages enabled, manage translations so that your global users can use Salesforce in their language. One of the ways is to use Custom Labels. Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a users native language. Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, Lightning Pages, or Lightning components. The values can be translated into any language Salesforce supports. With this explanation, the correct answer is Use Custom Labels to ensure custom messages are translated properly. References: https://help.salesforce.com/s/articleView?id=sf.cl_about.htm&type=5 https://help.salesforce.com/s/articleView?id=sf.workbench_overview.htm&type=5
Question 3 of 58
3. Question
As a part of custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change: Amount, Probability, Stage, or Close Date How should the developer access the data that must be displayed?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 4 of 58
4. Question
Which statement is true regarding savepoints?
Correct
This question is related to the concept of Transaction Control in Salesforce. Lets learn about savepoints and considerations.
Sometimes during the processing of records, your business rules require that partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
Screenshot SavePoint Example
In this example, if any error occurs while inserting the Contact cont then the entire transaction will be rolled back to savepoint sp1 (as specified in the catch section by Database.rollback method).
This question is related to the concept of Transaction Control in Salesforce. Lets learn about savepoints and considerations.
Sometimes during the processing of records, your business rules require that partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
Screenshot SavePoint Example
In this example, if any error occurs while inserting the Contact cont then the entire transaction will be rolled back to savepoint sp1 (as specified in the catch section by Database.rollback method).
This question is related to the concept of Transaction Control in Salesforce. Lets learn about savepoints and considerations.
Sometimes during the processing of records, your business rules require that partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
Screenshot SavePoint Example
In this example, if any error occurs while inserting the Contact cont then the entire transaction will be rolled back to savepoint sp1 (as specified in the catch section by Database.rollback method).
A company has code to update a Request and Request Lines and make a callout to their external ERP systems REST endpoint with the updated records.
The CalloutUtill.makeRestCallout falls with a You have uncommitted work pending. Please commit or rollback before calling out error.
What should be done to address the problem?
Correct
This is a scenario-based question that is related to performing DML operations and REST callout.
The scenario given in this question is:
There is a code to update a Request and Request Lines and make a callout to their external ERP systems REST endpoint with the updated records.
The CalloutUtill.makeRestCallout falls with a You have uncommitted work pending. Please commit or rollback before calling out error.
Please Note:
Callouts are not allowed when there is an uncommitted transaction pending. The resolution of this problem is to make the callout in a separate context.
We either need to commit the transaction, make the callout prior to any database changes or move your callout to an @future method.
With this explanation, the correct answer is:
Option Change the CalloutUtil.makeRestCallout to an @future method is correct.
Reference: https://help.salesforce.com/s/articleView?id=000328873&type=1
Incorrect
This is a scenario-based question that is related to performing DML operations and REST callout.
The scenario given in this question is:
There is a code to update a Request and Request Lines and make a callout to their external ERP systems REST endpoint with the updated records.
The CalloutUtill.makeRestCallout falls with a You have uncommitted work pending. Please commit or rollback before calling out error.
Please Note:
Callouts are not allowed when there is an uncommitted transaction pending. The resolution of this problem is to make the callout in a separate context.
We either need to commit the transaction, make the callout prior to any database changes or move your callout to an @future method.
With this explanation, the correct answer is:
Option Change the CalloutUtil.makeRestCallout to an @future method is correct.
Reference: https://help.salesforce.com/s/articleView?id=000328873&type=1
Unattempted
This is a scenario-based question that is related to performing DML operations and REST callout.
The scenario given in this question is:
There is a code to update a Request and Request Lines and make a callout to their external ERP systems REST endpoint with the updated records.
The CalloutUtill.makeRestCallout falls with a You have uncommitted work pending. Please commit or rollback before calling out error.
Please Note:
Callouts are not allowed when there is an uncommitted transaction pending. The resolution of this problem is to make the callout in a separate context.
We either need to commit the transaction, make the callout prior to any database changes or move your callout to an @future method.
With this explanation, the correct answer is:
Option Change the CalloutUtil.makeRestCallout to an @future method is correct.
Reference: https://help.salesforce.com/s/articleView?id=000328873&type=1
Question 6 of 58
6. Question
As part of their quoting and ordering process, a company needs to send PDFs to their document storage system‘s REST endpoint that supports OAuth 2.0. Each Salesforce user must be individually authenticated with the document storage system to send the PDF. What is the optimal way for a developer to implement the authentication to the REST endpoint?
Correct
This is a scenario-based question related to the authentication while Integrating with external systems in Salesforce. The scenario given in this question is: There is a REST endpoint that supports OAuth 2.0 Each Salesforce user must be individually authenticated with the system Lets understand a few concepts. OAuth 2.0 OAuth 2.0 is the industry-standard protocol (NOT specific to Salesforce) for providing authorization to web applications. Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To simplify the setup of authenticated callouts, specify a named credential as the callout endpoint. A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4. You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level. With this explanation, the correct answer is: Option Named Credential with an OAuth Authentication Provider is correct. For more reference & Setup https://help.salesforce.com/s/articleView?id=sf.named_credentials_about.htm&type=5
Incorrect
This is a scenario-based question related to the authentication while Integrating with external systems in Salesforce. The scenario given in this question is: There is a REST endpoint that supports OAuth 2.0 Each Salesforce user must be individually authenticated with the system Lets understand a few concepts. OAuth 2.0 OAuth 2.0 is the industry-standard protocol (NOT specific to Salesforce) for providing authorization to web applications. Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To simplify the setup of authenticated callouts, specify a named credential as the callout endpoint. A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4. You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level. With this explanation, the correct answer is: Option Named Credential with an OAuth Authentication Provider is correct. For more reference & Setup https://help.salesforce.com/s/articleView?id=sf.named_credentials_about.htm&type=5
Unattempted
This is a scenario-based question related to the authentication while Integrating with external systems in Salesforce. The scenario given in this question is: There is a REST endpoint that supports OAuth 2.0 Each Salesforce user must be individually authenticated with the system Lets understand a few concepts. OAuth 2.0 OAuth 2.0 is the industry-standard protocol (NOT specific to Salesforce) for providing authorization to web applications. Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To simplify the setup of authenticated callouts, specify a named credential as the callout endpoint. A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4. You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level. With this explanation, the correct answer is: Option Named Credential with an OAuth Authentication Provider is correct. For more reference & Setup https://help.salesforce.com/s/articleView?id=sf.named_credentials_about.htm&type=5
Question 7 of 58
7. Question
What are the three benefits of using static resources in Visualforce and Aura components? Choose 3 answers.
Correct
This question is related to the usage of Static Resource in Visualforce and Aura Components. Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. Static resources can be used only within your Salesforce org, so you cant host content here for other apps or websites. As per Salesforce documentation, the correct answers of this question are: Option Relative paths can be used in files in static resource archives to refer to other content within the archive is CORRECT Option Static resource files can be referenced by using the $Resource global variable instead of hardcoded is CORRECT Option Static resource files can be packaged into a collection of related files in a zip or jar archive is CORRECT Reference: https://help.salesforce.com/s/articleView?id=sf.pages_static_resources.htm&type=5
Incorrect
This question is related to the usage of Static Resource in Visualforce and Aura Components. Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. Static resources can be used only within your Salesforce org, so you cant host content here for other apps or websites. As per Salesforce documentation, the correct answers of this question are: Option Relative paths can be used in files in static resource archives to refer to other content within the archive is CORRECT Option Static resource files can be referenced by using the $Resource global variable instead of hardcoded is CORRECT Option Static resource files can be packaged into a collection of related files in a zip or jar archive is CORRECT Reference: https://help.salesforce.com/s/articleView?id=sf.pages_static_resources.htm&type=5
Unattempted
This question is related to the usage of Static Resource in Visualforce and Aura Components. Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. Static resources can be used only within your Salesforce org, so you cant host content here for other apps or websites. As per Salesforce documentation, the correct answers of this question are: Option Relative paths can be used in files in static resource archives to refer to other content within the archive is CORRECT Option Static resource files can be referenced by using the $Resource global variable instead of hardcoded is CORRECT Option Static resource files can be packaged into a collection of related files in a zip or jar archive is CORRECT Reference: https://help.salesforce.com/s/articleView?id=sf.pages_static_resources.htm&type=5
Question 8 of 58
8. Question
Which use case can only be performed by using asynchronous Apex?
Correct
This is a scenario-based question that is related to using Asynchronous Apex in Salesforce.
Among the four options given, the ask is:
which use case can only be performed by using asynchronous Apex?
Asynchronous Apex:
An asynchronous process is a process or function that executes a task “in the background“ without the user having to wait for the task to finish.
Asynchronous Apex comes in a number of different flavors. Well get into more detail for each one shortly, but heres a high-level overview.
The following three reasons are usually behind choosing asynchronous programming.
Processing a very large number of records: This reason is unique to the multi-tenanted world of the Lightning Platform where limits rule. The limits associated with asynchronous processes are higher than those with synchronous processes. Therefore, if you need to process thousands or even millions of records, asynchronous processing is your best bet.
Making callouts to external web services: Callouts can take a long time to process, but in the Lightning Platform, triggers cant make callouts directly.
Creating a better and faster user experience: by offloading some processing to asynchronous calls. Why do everything at once? If it can wait, let it.
With this explanation, the correct answer is:
Option Calling a web service from an Apex trigger is correct because we cannot call external web services synchronously from triggers, because calling a web service synchronously from triggers will hold up the database transaction until the callout is completed. In this scenario, we can invoke callouts from triggers by encapsulating the callouts in @future methods. (Asynchronous Apex)
Reference: https://help.salesforce.com/s/articleView?id=000330691&type=1
Incorrect
This is a scenario-based question that is related to using Asynchronous Apex in Salesforce.
Among the four options given, the ask is:
which use case can only be performed by using asynchronous Apex?
Asynchronous Apex:
An asynchronous process is a process or function that executes a task “in the background“ without the user having to wait for the task to finish.
Asynchronous Apex comes in a number of different flavors. Well get into more detail for each one shortly, but heres a high-level overview.
The following three reasons are usually behind choosing asynchronous programming.
Processing a very large number of records: This reason is unique to the multi-tenanted world of the Lightning Platform where limits rule. The limits associated with asynchronous processes are higher than those with synchronous processes. Therefore, if you need to process thousands or even millions of records, asynchronous processing is your best bet.
Making callouts to external web services: Callouts can take a long time to process, but in the Lightning Platform, triggers cant make callouts directly.
Creating a better and faster user experience: by offloading some processing to asynchronous calls. Why do everything at once? If it can wait, let it.
With this explanation, the correct answer is:
Option Calling a web service from an Apex trigger is correct because we cannot call external web services synchronously from triggers, because calling a web service synchronously from triggers will hold up the database transaction until the callout is completed. In this scenario, we can invoke callouts from triggers by encapsulating the callouts in @future methods. (Asynchronous Apex)
Reference: https://help.salesforce.com/s/articleView?id=000330691&type=1
Unattempted
This is a scenario-based question that is related to using Asynchronous Apex in Salesforce.
Among the four options given, the ask is:
which use case can only be performed by using asynchronous Apex?
Asynchronous Apex:
An asynchronous process is a process or function that executes a task “in the background“ without the user having to wait for the task to finish.
Asynchronous Apex comes in a number of different flavors. Well get into more detail for each one shortly, but heres a high-level overview.
The following three reasons are usually behind choosing asynchronous programming.
Processing a very large number of records: This reason is unique to the multi-tenanted world of the Lightning Platform where limits rule. The limits associated with asynchronous processes are higher than those with synchronous processes. Therefore, if you need to process thousands or even millions of records, asynchronous processing is your best bet.
Making callouts to external web services: Callouts can take a long time to process, but in the Lightning Platform, triggers cant make callouts directly.
Creating a better and faster user experience: by offloading some processing to asynchronous calls. Why do everything at once? If it can wait, let it.
With this explanation, the correct answer is:
Option Calling a web service from an Apex trigger is correct because we cannot call external web services synchronously from triggers, because calling a web service synchronously from triggers will hold up the database transaction until the callout is completed. In this scenario, we can invoke callouts from triggers by encapsulating the callouts in @future methods. (Asynchronous Apex)
Reference: https://help.salesforce.com/s/articleView?id=000330691&type=1
Question 9 of 58
9. Question
A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build a single Java application that can create, retrieve, and update common object records in all of the different orgs. Which method of integration should the application use?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 10 of 58
10. Question
Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates?
Choose 3 answers.
Correct
This question is related to implementing AJAX behavior to perform partial page updates. Let’s understand a few concepts of Visualforce Page.
Implementing Partial Page Updates with Command Links and Buttons
One of the most widely used Ajax behaviors is a partial page update, in which only a specific portion of a page is updated following some user action, rather than a reload of the entire page.
The simplest way to implement a partial page update is to use the reRender attribute on an or tag to identify a component that should be refreshed. When a user clicks the button or link, only the identified component and all of its child components are refreshed.
Screenshot VF Page to perform partial page updates
Screenshot Invoking the above VF Page for Account AB Textile
Implementing Partial Page Updates using
Using command links and buttons to implement a partial page update is relatively simple, but suppose you want to have the same page update occur just by hovering the mouse over a contact‘s name?
To do this with the contact list example, remove the tag from the data table and wrap the contact name in an tag instead. Within this output panel, add an element as a sibling of the contact‘s name.
Therefore, in such scenarios we can use for sample code please refer:
ttps://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
With this explanation, the correct answers are:
Option A is CORRECT
Option C is CORRECT
Option E is CORRECT.
References: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_updates.htm https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
Incorrect
This question is related to implementing AJAX behavior to perform partial page updates. Let’s understand a few concepts of Visualforce Page.
Implementing Partial Page Updates with Command Links and Buttons
One of the most widely used Ajax behaviors is a partial page update, in which only a specific portion of a page is updated following some user action, rather than a reload of the entire page.
The simplest way to implement a partial page update is to use the reRender attribute on an or tag to identify a component that should be refreshed. When a user clicks the button or link, only the identified component and all of its child components are refreshed.
Screenshot VF Page to perform partial page updates
Screenshot Invoking the above VF Page for Account AB Textile
Implementing Partial Page Updates using
Using command links and buttons to implement a partial page update is relatively simple, but suppose you want to have the same page update occur just by hovering the mouse over a contact‘s name?
To do this with the contact list example, remove the tag from the data table and wrap the contact name in an tag instead. Within this output panel, add an element as a sibling of the contact‘s name.
Therefore, in such scenarios we can use for sample code please refer:
ttps://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
With this explanation, the correct answers are:
Option A is CORRECT
Option C is CORRECT
Option E is CORRECT.
References: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_updates.htm https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
Unattempted
This question is related to implementing AJAX behavior to perform partial page updates. Let’s understand a few concepts of Visualforce Page.
Implementing Partial Page Updates with Command Links and Buttons
One of the most widely used Ajax behaviors is a partial page update, in which only a specific portion of a page is updated following some user action, rather than a reload of the entire page.
The simplest way to implement a partial page update is to use the reRender attribute on an or tag to identify a component that should be refreshed. When a user clicks the button or link, only the identified component and all of its child components are refreshed.
Screenshot VF Page to perform partial page updates
Screenshot Invoking the above VF Page for Account AB Textile
Implementing Partial Page Updates using
Using command links and buttons to implement a partial page update is relatively simple, but suppose you want to have the same page update occur just by hovering the mouse over a contact‘s name?
To do this with the contact list example, remove the tag from the data table and wrap the contact name in an tag instead. Within this output panel, add an element as a sibling of the contact‘s name.
Therefore, in such scenarios we can use for sample code please refer:
ttps://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
With this explanation, the correct answers are:
Option A is CORRECT
Option C is CORRECT
Option E is CORRECT.
References: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_updates.htm https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_ajax_partial_page_update_any_component.htm
Question 11 of 58
11. Question
Cloud Kicks (CK) has an existing automation where a custom record called Account Plan is created upon an Account being marked as a Customer. Recently, a Workflow Rule was added so that whenever an Account is marked as a Customer, a Customer Since date field is updated with todays date.
Now, since the addition of the Workflow Rule, two Account Plan records are created whenever the Account is marked as a Customer.
What might cause this to happen?
Correct
This question is a scenario-based question and is related to the concept of Trigger Order of Execution in Salesforce.
Lets understand the scenario given in the question:
Apex trigger on Account that creates an Account Plan record when in Account is marked as a customer.
o That means, this Apex Trigger is written on after update event. When the Account Type is updated to Customer, the apex trigger logic fires and creates a record of the Account Plan object.
Recently a workflow rule was added so that whenever an Account is marked as a customer, a Customer Since date field is updated with today‘s date.
o That means a workflow rule is created which fires when Account Type field value is updated to Customer and the field update action updates the date field Customer Since on Account with todays date.
The issue is given in the question:
After the addition of the workflow rule, two Account Plan records are created whenever the Account is marked as a Customer.
Lets discuss debugging:
As we know, the logic to create a record of the Account Plan is written in the Apex Trigger which executes and creates a single record of the Account Plan. If two Account Plan records are created, that means this trigger logic is getting fired two times. BUT WHY?
To understand this, lets understand about Trigger Order of execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT. Salesforce performs the following events in the below order.
If you see Point-13, it says that if the field was updated with workflow field update, the before and after update triggers are fired one more time (and only one more time). With this point, it‘s clear that the workflow rule added in this scenario is calling the after-update trigger again, and therefore, two Account Plan records are created.
Handle Recursion in Trigger:
To avoid the recursion of a trigger, make sure your trigger is getting executed only one time. You can use the Static Boolean variable in the apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
That means the Apex Trigger logic in this scenario does not use a static variable to ensure it only fires once. With this explanation, the correct answer is:
Option The Apex Trigger responsible for the record creation does not use a static variable to ensure it only fires once is correct.
Lets see the below screenshot for more understanding. The code given in the below screenshot uses a static Boolean variable to avoid Recursion.
Screenshot Apex Class having Boolean Variable
Screenshot Apex Trigger Code using Boolean variable so that Trigger should fire once
This question is a scenario-based question and is related to the concept of Trigger Order of Execution in Salesforce.
Lets understand the scenario given in the question:
Apex trigger on Account that creates an Account Plan record when in Account is marked as a customer.
o That means, this Apex Trigger is written on after update event. When the Account Type is updated to Customer, the apex trigger logic fires and creates a record of the Account Plan object.
Recently a workflow rule was added so that whenever an Account is marked as a customer, a Customer Since date field is updated with today‘s date.
o That means a workflow rule is created which fires when Account Type field value is updated to Customer and the field update action updates the date field Customer Since on Account with todays date.
The issue is given in the question:
After the addition of the workflow rule, two Account Plan records are created whenever the Account is marked as a Customer.
Lets discuss debugging:
As we know, the logic to create a record of the Account Plan is written in the Apex Trigger which executes and creates a single record of the Account Plan. If two Account Plan records are created, that means this trigger logic is getting fired two times. BUT WHY?
To understand this, lets understand about Trigger Order of execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT. Salesforce performs the following events in the below order.
If you see Point-13, it says that if the field was updated with workflow field update, the before and after update triggers are fired one more time (and only one more time). With this point, it‘s clear that the workflow rule added in this scenario is calling the after-update trigger again, and therefore, two Account Plan records are created.
Handle Recursion in Trigger:
To avoid the recursion of a trigger, make sure your trigger is getting executed only one time. You can use the Static Boolean variable in the apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
That means the Apex Trigger logic in this scenario does not use a static variable to ensure it only fires once. With this explanation, the correct answer is:
Option The Apex Trigger responsible for the record creation does not use a static variable to ensure it only fires once is correct.
Lets see the below screenshot for more understanding. The code given in the below screenshot uses a static Boolean variable to avoid Recursion.
Screenshot Apex Class having Boolean Variable
Screenshot Apex Trigger Code using Boolean variable so that Trigger should fire once
This question is a scenario-based question and is related to the concept of Trigger Order of Execution in Salesforce.
Lets understand the scenario given in the question:
Apex trigger on Account that creates an Account Plan record when in Account is marked as a customer.
o That means, this Apex Trigger is written on after update event. When the Account Type is updated to Customer, the apex trigger logic fires and creates a record of the Account Plan object.
Recently a workflow rule was added so that whenever an Account is marked as a customer, a Customer Since date field is updated with today‘s date.
o That means a workflow rule is created which fires when Account Type field value is updated to Customer and the field update action updates the date field Customer Since on Account with todays date.
The issue is given in the question:
After the addition of the workflow rule, two Account Plan records are created whenever the Account is marked as a Customer.
Lets discuss debugging:
As we know, the logic to create a record of the Account Plan is written in the Apex Trigger which executes and creates a single record of the Account Plan. If two Account Plan records are created, that means this trigger logic is getting fired two times. BUT WHY?
To understand this, lets understand about Trigger Order of execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT. Salesforce performs the following events in the below order.
If you see Point-13, it says that if the field was updated with workflow field update, the before and after update triggers are fired one more time (and only one more time). With this point, it‘s clear that the workflow rule added in this scenario is calling the after-update trigger again, and therefore, two Account Plan records are created.
Handle Recursion in Trigger:
To avoid the recursion of a trigger, make sure your trigger is getting executed only one time. You can use the Static Boolean variable in the apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
That means the Apex Trigger logic in this scenario does not use a static variable to ensure it only fires once. With this explanation, the correct answer is:
Option The Apex Trigger responsible for the record creation does not use a static variable to ensure it only fires once is correct.
Lets see the below screenshot for more understanding. The code given in the below screenshot uses a static Boolean variable to avoid Recursion.
Screenshot Apex Class having Boolean Variable
Screenshot Apex Trigger Code using Boolean variable so that Trigger should fire once
Dreamscape Flowers (DF) needs to integrate with their own, existing, internal custom web application. The application accepts JSON payloads, resizes product images, and sends the resized back to Salesforce. What should the developer use to implement this integration?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 13 of 58
13. Question
Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs.
What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?
Correct
This is a scenario-based question related to Lightning Component. The scenario given in this question is:
Lightning Component should display the total number of Opportunities in the org.
The Lightning Component uses an Apex Controller to get the data it needs.
To discover the number of rows that a query returns, use the aggregate function COUNT () in a SELECT statement of a SOQL query.
Lets do some hands-on
Screenshot Apex Controller & Method to return Opportunity Count
This is a scenario-based question related to Lightning Component. The scenario given in this question is:
Lightning Component should display the total number of Opportunities in the org.
The Lightning Component uses an Apex Controller to get the data it needs.
To discover the number of rows that a query returns, use the aggregate function COUNT () in a SELECT statement of a SOQL query.
Lets do some hands-on
Screenshot Apex Controller & Method to return Opportunity Count
This is a scenario-based question related to Lightning Component. The scenario given in this question is:
Lightning Component should display the total number of Opportunities in the org.
The Lightning Component uses an Apex Controller to get the data it needs.
To discover the number of rows that a query returns, use the aggregate function COUNT () in a SELECT statement of a SOQL query.
Lets do some hands-on
Screenshot Apex Controller & Method to return Opportunity Count
A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints. The information needs to be displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process.
How should a developer implement the callouts?
Correct
This is a scenario-based question that is related to making long-running callouts in Apex.
Sometimes we may come across certain business scenarios where we need webservice callouts that will take longer to respond. This is because the other end needs to do a significant amount of work prior to responding back. if the other end process a huge number of transactions during peak loads, the response will be even slower.
To resolve the above Salesforce limitation, we can use Continuation Class which makes asynchronous callout using REST and SOAP services. Using this class, we can make a long-running request from a Visualforce page to external systems, and its response is returned through a callback method.
Screenshot Execution Flow of Long-Running Callout
Now, coming back to the question, it says:
A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints.
Each endpoint might take up to two minutes to process. (Long Running Callout)
With this explanation, the correct answer is:
Option A Continuation for both the billing callout and the tax callout is correct because both the endpoint might take up to 2 minutes to process which is considered as Long-Running Callout.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_overview.htm
Incorrect
This is a scenario-based question that is related to making long-running callouts in Apex.
Sometimes we may come across certain business scenarios where we need webservice callouts that will take longer to respond. This is because the other end needs to do a significant amount of work prior to responding back. if the other end process a huge number of transactions during peak loads, the response will be even slower.
To resolve the above Salesforce limitation, we can use Continuation Class which makes asynchronous callout using REST and SOAP services. Using this class, we can make a long-running request from a Visualforce page to external systems, and its response is returned through a callback method.
Screenshot Execution Flow of Long-Running Callout
Now, coming back to the question, it says:
A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints.
Each endpoint might take up to two minutes to process. (Long Running Callout)
With this explanation, the correct answer is:
Option A Continuation for both the billing callout and the tax callout is correct because both the endpoint might take up to 2 minutes to process which is considered as Long-Running Callout.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_overview.htm
Unattempted
This is a scenario-based question that is related to making long-running callouts in Apex.
Sometimes we may come across certain business scenarios where we need webservice callouts that will take longer to respond. This is because the other end needs to do a significant amount of work prior to responding back. if the other end process a huge number of transactions during peak loads, the response will be even slower.
To resolve the above Salesforce limitation, we can use Continuation Class which makes asynchronous callout using REST and SOAP services. Using this class, we can make a long-running request from a Visualforce page to external systems, and its response is returned through a callback method.
Screenshot Execution Flow of Long-Running Callout
Now, coming back to the question, it says:
A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints.
Each endpoint might take up to two minutes to process. (Long Running Callout)
With this explanation, the correct answer is:
Option A Continuation for both the billing callout and the tax callout is correct because both the endpoint might take up to 2 minutes to process which is considered as Long-Running Callout.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_continuation_overview.htm
Question 15 of 58
15. Question
What is the benefit of JavaScript remoting over Visualforce Remote Objects?
Correct
This question is related to the concept of JavaScript Remoting & Remote Objects in Salesforce. Lets look at Salesforce Documentation to check the differences between JavaScript Remoting & Remote Objects.
This question is related to the concept of JavaScript Remoting & Remote Objects in Salesforce. Lets look at Salesforce Documentation to check the differences between JavaScript Remoting & Remote Objects.
This question is related to the concept of JavaScript Remoting & Remote Objects in Salesforce. Lets look at Salesforce Documentation to check the differences between JavaScript Remoting & Remote Objects.
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter ViewState errors when using it in Production. What should the developer ensure to correct these errors?
Correct
This question is related to the performance of the visual force page in Salesforce. The scenario given in this question is: A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter ViewState errors when using it in Production. Visualforce is designed to provide developers with the ability to match the functionality, behavior, and performance of standard Salesforce pages. There are different Visualforce performance issues and one of them is View State Size. The view state size of your Visualforce pages must be under 170KB. By reducing your view state size, your pages can load quicker and stall less often. You can monitor view state performance through the View State tab in the development mode footer and take the following actions: o Use the transient keyword in your Apex controllers for variables that arent essential for maintaining state and arent necessary during page refreshes. o If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your SOQL calls to return only data that‘s relevant to the Visualforce page. o If your view state is affected by a large component tree, try reducing the number of components your page depends on. With this explanation, the correct answer is Ensure variables are marked as Transient Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_best_practices_performance.htm
Incorrect
This question is related to the performance of the visual force page in Salesforce. The scenario given in this question is: A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter ViewState errors when using it in Production. Visualforce is designed to provide developers with the ability to match the functionality, behavior, and performance of standard Salesforce pages. There are different Visualforce performance issues and one of them is View State Size. The view state size of your Visualforce pages must be under 170KB. By reducing your view state size, your pages can load quicker and stall less often. You can monitor view state performance through the View State tab in the development mode footer and take the following actions: o Use the transient keyword in your Apex controllers for variables that arent essential for maintaining state and arent necessary during page refreshes. o If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your SOQL calls to return only data that‘s relevant to the Visualforce page. o If your view state is affected by a large component tree, try reducing the number of components your page depends on. With this explanation, the correct answer is Ensure variables are marked as Transient Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_best_practices_performance.htm
Unattempted
This question is related to the performance of the visual force page in Salesforce. The scenario given in this question is: A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter ViewState errors when using it in Production. Visualforce is designed to provide developers with the ability to match the functionality, behavior, and performance of standard Salesforce pages. There are different Visualforce performance issues and one of them is View State Size. The view state size of your Visualforce pages must be under 170KB. By reducing your view state size, your pages can load quicker and stall less often. You can monitor view state performance through the View State tab in the development mode footer and take the following actions: o Use the transient keyword in your Apex controllers for variables that arent essential for maintaining state and arent necessary during page refreshes. o If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your SOQL calls to return only data that‘s relevant to the Visualforce page. o If your view state is affected by a large component tree, try reducing the number of components your page depends on. With this explanation, the correct answer is Ensure variables are marked as Transient Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_best_practices_performance.htm
Question 17 of 58
17. Question
Refer to the following code snippet:
A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by imperatively calling getFetchLeadList when certain criteria are met.
What are three changes the developer should implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?
Choose 3 answers.
Correct
This is a scenario-based question that is related to calling Apex Method from Lightning Web Components. The scenario given in this question is:
There is an Apex Controller LeadController and a method getFetchLeadList() which returns a List of Lead-based on searchTerm.
There is a Lightning Web Component having a JavaScript function that imperatively calls getFetchLeadList() method when certain criteria are met.
The ask is: In the given apex code, what are three changes the developer should implement to ensure LWC can display data efferently while preserving security.
Lets check the given options and find the correct answers.
Option Implement the with sharing keyword in the class declaration is correct because as per apex best practice, Apex without an explicit sharing declaration is insecure by default. We strongly recommend that you always specify a sharing declaration for a class. Use the with sharing keyword when declaring a class to enforce sharing rules of the current user. Explicitly setting this keyword ensures that Apex code runs in the current user context.
Option Annotate the Apex method with @AuraEnabled(Cacheable=true) is correct because:
We need to use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
To improve runtime performance, set @AuraEnabled(cacheable=true) to cache the method results on the client. To set cacheable=true, a method must only get data. It cant mutate data.
Option Use the WITH SECURITY_ENFORCED clause within the SOQL query is correct because we should use the WITH SECURITY_ENFORCED clause to enable field- and object-level security permissions checking for SOQL SELECT queries in Apex code, including subqueries and cross-object relationships.
Screenshot Updated Code is given in Question
This is a scenario-based question that is related to calling Apex Method from Lightning Web Components. The scenario given in this question is:
There is an Apex Controller LeadController and a method getFetchLeadList() which returns a List of Lead-based on searchTerm.
There is a Lightning Web Component having a JavaScript function that imperatively calls getFetchLeadList() method when certain criteria are met.
The ask is: In the given apex code, what are three changes the developer should implement to ensure LWC can display data efferently while preserving security.
Lets check the given options and find the correct answers.
Option Implement the with sharing keyword in the class declaration is correct because as per apex best practice, Apex without an explicit sharing declaration is insecure by default. We strongly recommend that you always specify a sharing declaration for a class. Use the with sharing keyword when declaring a class to enforce sharing rules of the current user. Explicitly setting this keyword ensures that Apex code runs in the current user context.
Option Annotate the Apex method with @AuraEnabled(Cacheable=true) is correct because:
We need to use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
To improve runtime performance, set @AuraEnabled(cacheable=true) to cache the method results on the client. To set cacheable=true, a method must only get data. It cant mutate data.
Option Use the WITH SECURITY_ENFORCED clause within the SOQL query is correct because we should use the WITH SECURITY_ENFORCED clause to enable field- and object-level security permissions checking for SOQL SELECT queries in Apex code, including subqueries and cross-object relationships.
Screenshot Updated Code is given in Question
This is a scenario-based question that is related to calling Apex Method from Lightning Web Components. The scenario given in this question is:
There is an Apex Controller LeadController and a method getFetchLeadList() which returns a List of Lead-based on searchTerm.
There is a Lightning Web Component having a JavaScript function that imperatively calls getFetchLeadList() method when certain criteria are met.
The ask is: In the given apex code, what are three changes the developer should implement to ensure LWC can display data efferently while preserving security.
Lets check the given options and find the correct answers.
Option Implement the with sharing keyword in the class declaration is correct because as per apex best practice, Apex without an explicit sharing declaration is insecure by default. We strongly recommend that you always specify a sharing declaration for a class. Use the with sharing keyword when declaring a class to enforce sharing rules of the current user. Explicitly setting this keyword ensures that Apex code runs in the current user context.
Option Annotate the Apex method with @AuraEnabled(Cacheable=true) is correct because:
We need to use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
To improve runtime performance, set @AuraEnabled(cacheable=true) to cache the method results on the client. To set cacheable=true, a method must only get data. It cant mutate data.
Option Use the WITH SECURITY_ENFORCED clause within the SOQL query is correct because we should use the WITH SECURITY_ENFORCED clause to enable field- and object-level security permissions checking for SOQL SELECT queries in Apex code, including subqueries and cross-object relationships.
Screenshot Updated Code is given in Question
A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed in the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:
@IsTest private Batch_Account_Update_Test() {
@IsTest static void UnitTest() {
Account a = new Account (Name=‘test‘, Type=‘Customer‘, Sales_Amount__c=0);
insert a;
Batch_Account_Sales bas = new Batch_Account_Sales();
ID jobid = database.executebatch(bas);
}
}
What is causing the code coverage problem?
Correct
This question is related to Apex Unit Test in Salesforce. The Apex testing framework enables you to write and execute tests for your Apex classes and triggers on the Lightning Platform. Apex unit tests ensure high quality for your Apex code and let you meet the requirements for deploying Apex.
Test methods must be defined in test classes, which are classes annotated with isTest. This sample class shows a definition of a test class with one test method.
Screenshot Syntax of Test Class
Now, coming back to the question. The scenario given in this question is:
There is a Batch Apex Class that works fine in Sandbox.
There is an Apex Test class written for the Batch Apex but the developer cannot get code coverage on the Batch Apex class.
Please Note: The ask in this question is to write Apex Test for Batch Class which is Asynchronous in nature. A unit test forms a single transaction, and asynchronous code enqueued within that transaction cannot be executed until the transaction commits successfully.
For this reason, Salesforce has provided a framework to force asynchronous code to execute synchronously for testing: We enclose our test code between Test.startTest() and Test.stopTest() methods.
The system collects all asynchronous calls made after startTest(). When stopTest() is executed, these collected asynchronous processes are then run synchronously and complete before control returns to our code.
But as we see, the sample Apex Test code given in this question does not used Test.startTest() and Test.stopTest() methods.
Screenshot Updated Apex Test Class
With this explanation, the correct answer is The executeBatch must fall within test.startTest() and test.stopTest()
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_tools_start_stop_test.htm
Incorrect
This question is related to Apex Unit Test in Salesforce. The Apex testing framework enables you to write and execute tests for your Apex classes and triggers on the Lightning Platform. Apex unit tests ensure high quality for your Apex code and let you meet the requirements for deploying Apex.
Test methods must be defined in test classes, which are classes annotated with isTest. This sample class shows a definition of a test class with one test method.
Screenshot Syntax of Test Class
Now, coming back to the question. The scenario given in this question is:
There is a Batch Apex Class that works fine in Sandbox.
There is an Apex Test class written for the Batch Apex but the developer cannot get code coverage on the Batch Apex class.
Please Note: The ask in this question is to write Apex Test for Batch Class which is Asynchronous in nature. A unit test forms a single transaction, and asynchronous code enqueued within that transaction cannot be executed until the transaction commits successfully.
For this reason, Salesforce has provided a framework to force asynchronous code to execute synchronously for testing: We enclose our test code between Test.startTest() and Test.stopTest() methods.
The system collects all asynchronous calls made after startTest(). When stopTest() is executed, these collected asynchronous processes are then run synchronously and complete before control returns to our code.
But as we see, the sample Apex Test code given in this question does not used Test.startTest() and Test.stopTest() methods.
Screenshot Updated Apex Test Class
With this explanation, the correct answer is The executeBatch must fall within test.startTest() and test.stopTest()
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_tools_start_stop_test.htm
Unattempted
This question is related to Apex Unit Test in Salesforce. The Apex testing framework enables you to write and execute tests for your Apex classes and triggers on the Lightning Platform. Apex unit tests ensure high quality for your Apex code and let you meet the requirements for deploying Apex.
Test methods must be defined in test classes, which are classes annotated with isTest. This sample class shows a definition of a test class with one test method.
Screenshot Syntax of Test Class
Now, coming back to the question. The scenario given in this question is:
There is a Batch Apex Class that works fine in Sandbox.
There is an Apex Test class written for the Batch Apex but the developer cannot get code coverage on the Batch Apex class.
Please Note: The ask in this question is to write Apex Test for Batch Class which is Asynchronous in nature. A unit test forms a single transaction, and asynchronous code enqueued within that transaction cannot be executed until the transaction commits successfully.
For this reason, Salesforce has provided a framework to force asynchronous code to execute synchronously for testing: We enclose our test code between Test.startTest() and Test.stopTest() methods.
The system collects all asynchronous calls made after startTest(). When stopTest() is executed, these collected asynchronous processes are then run synchronously and complete before control returns to our code.
But as we see, the sample Apex Test code given in this question does not used Test.startTest() and Test.stopTest() methods.
Screenshot Updated Apex Test Class
With this explanation, the correct answer is The executeBatch must fall within test.startTest() and test.stopTest()
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_tools_start_stop_test.htm
Question 19 of 58
19. Question
A developer has a Visualforce page that automatically assigns ownership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?
Correct
This is a scenario-based question related to the concept of Apex Test Class in Salesforce. The scenario given in this question is:
Visualforce page that automatically assigns ownership of an Account to a queue upon save.
The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
o This means the Apex Test class written is getting failed and the reason is the expected and the actual value for owner is different.
Lets take a simple example & reproduce the same scenario with Case Object.
There is an Apex Class & method to update the specific Case record to Queue.
There is an Apex Test Class to cover this scenario.
At LINE-20 of Apex Test Class CaseExTest, we expect the Case Owner to be updated to Queue.
Screenshot Apex Class having method updateCaseOwner
Screenshot Apex Test Class
Screenshot Test Class failed with below Error
Please Note: If you see LINE-20 of the above Apex Test Class, it does not retrieve the updated case record. Therefore, the resolution of this issue is we need to fetch the latest version of Apex Test Class and assert it.
Screenshot Updated Test Class
With this explanation, the correct answer is:
Option The test class does not retrieve the updated value from the database is correct.
Incorrect
This is a scenario-based question related to the concept of Apex Test Class in Salesforce. The scenario given in this question is:
Visualforce page that automatically assigns ownership of an Account to a queue upon save.
The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
o This means the Apex Test class written is getting failed and the reason is the expected and the actual value for owner is different.
Lets take a simple example & reproduce the same scenario with Case Object.
There is an Apex Class & method to update the specific Case record to Queue.
There is an Apex Test Class to cover this scenario.
At LINE-20 of Apex Test Class CaseExTest, we expect the Case Owner to be updated to Queue.
Screenshot Apex Class having method updateCaseOwner
Screenshot Apex Test Class
Screenshot Test Class failed with below Error
Please Note: If you see LINE-20 of the above Apex Test Class, it does not retrieve the updated case record. Therefore, the resolution of this issue is we need to fetch the latest version of Apex Test Class and assert it.
Screenshot Updated Test Class
With this explanation, the correct answer is:
Option The test class does not retrieve the updated value from the database is correct.
Unattempted
This is a scenario-based question related to the concept of Apex Test Class in Salesforce. The scenario given in this question is:
Visualforce page that automatically assigns ownership of an Account to a queue upon save.
The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
o This means the Apex Test class written is getting failed and the reason is the expected and the actual value for owner is different.
Lets take a simple example & reproduce the same scenario with Case Object.
There is an Apex Class & method to update the specific Case record to Queue.
There is an Apex Test Class to cover this scenario.
At LINE-20 of Apex Test Class CaseExTest, we expect the Case Owner to be updated to Queue.
Screenshot Apex Class having method updateCaseOwner
Screenshot Apex Test Class
Screenshot Test Class failed with below Error
Please Note: If you see LINE-20 of the above Apex Test Class, it does not retrieve the updated case record. Therefore, the resolution of this issue is we need to fetch the latest version of Apex Test Class and assert it.
Screenshot Updated Test Class
With this explanation, the correct answer is:
Option The test class does not retrieve the updated value from the database is correct.
Question 20 of 58
20. Question
A company has a custom object Sales_Help_Request__c that has a Lookup relationship to Opportunity. The Sales_Help_Request__c has a number field, Number_of_Hours__c, that represents the amount of time spent on the Sales_Help_Request__c. A developer is tasked with creating a field, Total_Hours__c, on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. What should the developer use to implement this?
Correct
This is a scenario-based question related to the concept of tracking fields on records. The scenario given in this question is: There are two objects. Standard object Opportunity and custom object Sales_Help_Request__c. Custom object Sales_Help_Request__c has lookup relationship to Standard object Opportunity There is a field Number_of_Hours__c on Custom object Sales_Help_Request__c to represents the amount of time spent on the Sales_Help_Request__c. There is a field Total_Hours__c on Standard object Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. The requirement is: How to populate the Total_Hours__c field on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. This requirement is very simple to implement by using Roll-up Summary Field if the relationship between two objects is a Master-Detail relationship. A roll-up summary field calculates values from related records, such as those in a related list. You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record. But, here we can not use roll-up summary field because the relationship between Opportunity and Sales_Help_Request__c is Lookup. There are 4 ways one can work around this: An AppExchange App A Flow Apex Triggers Reporting With this explanation, the correct answer is A trigger on Sales_Help_Request__c because when the Number_of_Hours__c field of any Sales_Help_Request__c record is changed, then for the corresponding Opportunity record, the logic needs to add all the Number_of_Hours__c field values and update the Total_Hours__c field on the Opportunity record.
Incorrect
This is a scenario-based question related to the concept of tracking fields on records. The scenario given in this question is: There are two objects. Standard object Opportunity and custom object Sales_Help_Request__c. Custom object Sales_Help_Request__c has lookup relationship to Standard object Opportunity There is a field Number_of_Hours__c on Custom object Sales_Help_Request__c to represents the amount of time spent on the Sales_Help_Request__c. There is a field Total_Hours__c on Standard object Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. The requirement is: How to populate the Total_Hours__c field on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. This requirement is very simple to implement by using Roll-up Summary Field if the relationship between two objects is a Master-Detail relationship. A roll-up summary field calculates values from related records, such as those in a related list. You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record. But, here we can not use roll-up summary field because the relationship between Opportunity and Sales_Help_Request__c is Lookup. There are 4 ways one can work around this: An AppExchange App A Flow Apex Triggers Reporting With this explanation, the correct answer is A trigger on Sales_Help_Request__c because when the Number_of_Hours__c field of any Sales_Help_Request__c record is changed, then for the corresponding Opportunity record, the logic needs to add all the Number_of_Hours__c field values and update the Total_Hours__c field on the Opportunity record.
Unattempted
This is a scenario-based question related to the concept of tracking fields on records. The scenario given in this question is: There are two objects. Standard object Opportunity and custom object Sales_Help_Request__c. Custom object Sales_Help_Request__c has lookup relationship to Standard object Opportunity There is a field Number_of_Hours__c on Custom object Sales_Help_Request__c to represents the amount of time spent on the Sales_Help_Request__c. There is a field Total_Hours__c on Standard object Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. The requirement is: How to populate the Total_Hours__c field on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. This requirement is very simple to implement by using Roll-up Summary Field if the relationship between two objects is a Master-Detail relationship. A roll-up summary field calculates values from related records, such as those in a related list. You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record. But, here we can not use roll-up summary field because the relationship between Opportunity and Sales_Help_Request__c is Lookup. There are 4 ways one can work around this: An AppExchange App A Flow Apex Triggers Reporting With this explanation, the correct answer is A trigger on Sales_Help_Request__c because when the Number_of_Hours__c field of any Sales_Help_Request__c record is changed, then for the corresponding Opportunity record, the logic needs to add all the Number_of_Hours__c field values and update the Total_Hours__c field on the Opportunity record.
Question 21 of 58
21. Question
A developer creates an application event that has triggered an infinite loop.
What may have caused this problem?
Correct
This question is related to an issue while creating an Application Event in Aura Component. The issue given in this question while creating the Application Event is:
Application event is triggering an infinite loop.
Lets understand the basics about Application Event
Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.
As per salesforce documentation, there are some anti-patterns that we should avoid when using events.
This question is related to an issue while creating an Application Event in Aura Component. The issue given in this question while creating the Application Event is:
Application event is triggering an infinite loop.
Lets understand the basics about Application Event
Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.
As per salesforce documentation, there are some anti-patterns that we should avoid when using events.
This question is related to an issue while creating an Application Event in Aura Component. The issue given in this question while creating the Application Event is:
Application event is triggering an infinite loop.
Lets understand the basics about Application Event
Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.
As per salesforce documentation, there are some anti-patterns that we should avoid when using events.
A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a runtime error occurs.
Why does the developer receive a runtime error?
Correct
This is a scenario-based question related to the concept of Transaction Control in Salesforce. The scenario given in this question is:
There is an Apex Class having three savepoints SP1, SP2 and SP3
There three savepoints are created in sequence/order.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
The problem is: When the code rolls back to SP3, the runtime error occurs.
Lets understand a few concepts about Transaction Control in Apex
While implementing using Apex, there are certain business rules which require partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
As per the Salesforce Documentation, there are the following limits while using savepoint variables and rolling back to the database.
Now, coming back to the question, the same scenario given in the question is yellow highlighted.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
With this explanation, the correct answer is:
Option SP3 became invalid when SP1 was rolled back is correct because savepoints SP1, SP2, and SP3 are in sequence and when the code rollbacks to SP1, the SP3 becomes invalid.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_transaction_control.htm
Incorrect
This is a scenario-based question related to the concept of Transaction Control in Salesforce. The scenario given in this question is:
There is an Apex Class having three savepoints SP1, SP2 and SP3
There three savepoints are created in sequence/order.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
The problem is: When the code rolls back to SP3, the runtime error occurs.
Lets understand a few concepts about Transaction Control in Apex
While implementing using Apex, there are certain business rules which require partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
As per the Salesforce Documentation, there are the following limits while using savepoint variables and rolling back to the database.
Now, coming back to the question, the same scenario given in the question is yellow highlighted.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
With this explanation, the correct answer is:
Option SP3 became invalid when SP1 was rolled back is correct because savepoints SP1, SP2, and SP3 are in sequence and when the code rollbacks to SP1, the SP3 becomes invalid.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_transaction_control.htm
Unattempted
This is a scenario-based question related to the concept of Transaction Control in Salesforce. The scenario given in this question is:
There is an Apex Class having three savepoints SP1, SP2 and SP3
There three savepoints are created in sequence/order.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
The problem is: When the code rolls back to SP3, the runtime error occurs.
Lets understand a few concepts about Transaction Control in Apex
While implementing using Apex, there are certain business rules which require partial work (already executed DML statements) be rolled back so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.
As per the Salesforce Documentation, there are the following limits while using savepoint variables and rolling back to the database.
Now, coming back to the question, the same scenario given in the question is yellow highlighted.
For a given condition, there is a logic to roll back to SP1. The code then calls roll back to SP3 to continue with the final execution.
With this explanation, the correct answer is:
Option SP3 became invalid when SP1 was rolled back is correct because savepoints SP1, SP2, and SP3 are in sequence and when the code rollbacks to SP1, the SP3 becomes invalid.
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_transaction_control.htm
Question 23 of 58
23. Question
As part of custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:
* Amount, Probability, Stage, or Close Date
What is the most efficient way to query such information?
Correct
This question is related to the concept of Field History Tracking in Salesforce. In Salesforce, we can select certain fields to track and display the field history in the History related list of an object.
Salesforce stores an objects tracked field history in an associated object called StandardObjectNameHistory or CustomObjectName__History. For example, OpportunityHistory represents the history of changes to the values of an Opportunity records fields. Similarly, MyCustomObject__History tracks field history for the MyCustomObject__c custom object.
OpportunityHistory
Represents the stage history of an Opportunity. This object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity.
As per Salesforce Documentation, to obtain information about how a particular opportunity is progressing, query the OpportunityHistory records associated with a given Opportunity. Please note that if an opportunity‘s Amount, Probability, Stage, or Close Date fields have not changed, nothing will be returned in the OpportunityHistory objects.
For Example, Lets say:
We created an Opportunity named AC INSTALLATION. At this time, we kept Amount as blank and Stage = Prospecting
Then we updated the Stage from Prospecting to Qualification.
Then we updated the Amount from blank to 1000000.
Now, lets Query to OpportunityHistory Object.
Screenshot Query to OpportunityHistory
This question is related to the concept of Field History Tracking in Salesforce. In Salesforce, we can select certain fields to track and display the field history in the History related list of an object.
Salesforce stores an objects tracked field history in an associated object called StandardObjectNameHistory or CustomObjectName__History. For example, OpportunityHistory represents the history of changes to the values of an Opportunity records fields. Similarly, MyCustomObject__History tracks field history for the MyCustomObject__c custom object.
OpportunityHistory
Represents the stage history of an Opportunity. This object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity.
As per Salesforce Documentation, to obtain information about how a particular opportunity is progressing, query the OpportunityHistory records associated with a given Opportunity. Please note that if an opportunity‘s Amount, Probability, Stage, or Close Date fields have not changed, nothing will be returned in the OpportunityHistory objects.
For Example, Lets say:
We created an Opportunity named AC INSTALLATION. At this time, we kept Amount as blank and Stage = Prospecting
Then we updated the Stage from Prospecting to Qualification.
Then we updated the Amount from blank to 1000000.
Now, lets Query to OpportunityHistory Object.
Screenshot Query to OpportunityHistory
This question is related to the concept of Field History Tracking in Salesforce. In Salesforce, we can select certain fields to track and display the field history in the History related list of an object.
Salesforce stores an objects tracked field history in an associated object called StandardObjectNameHistory or CustomObjectName__History. For example, OpportunityHistory represents the history of changes to the values of an Opportunity records fields. Similarly, MyCustomObject__History tracks field history for the MyCustomObject__c custom object.
OpportunityHistory
Represents the stage history of an Opportunity. This object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity.
As per Salesforce Documentation, to obtain information about how a particular opportunity is progressing, query the OpportunityHistory records associated with a given Opportunity. Please note that if an opportunity‘s Amount, Probability, Stage, or Close Date fields have not changed, nothing will be returned in the OpportunityHistory objects.
For Example, Lets say:
We created an Opportunity named AC INSTALLATION. At this time, we kept Amount as blank and Stage = Prospecting
Then we updated the Stage from Prospecting to Qualification.
Then we updated the Amount from blank to 1000000.
Now, lets Query to OpportunityHistory Object.
Screenshot Query to OpportunityHistory
A company needs to automatically delete sensitive information after seven years. This could delete almost a million records every day.
How can this be achieved?
Correct
This is a scenario-based question. The scenario given in this question is:
A company needs to automatically delete sensitive information after seven years.
This could delete almost a million records every day.
Conclusion
The records deleted will be in high volume (millions of records)
This scenario does not require any synchronous behavior as the records should be deleted after 7 years.
Solution Approach
We need to use the asynchronous apex feature of Salesforce as the data deletion needs to happen in the backend without impacting any other logic.
We need to specifically use Batch Apex (Asynchronous Apex) because the requirement is of data cleaning which may be millions of records.
Lets learn more about a high-level overview of Asynchronous Apex features with use cases.
This is a scenario-based question. The scenario given in this question is:
A company needs to automatically delete sensitive information after seven years.
This could delete almost a million records every day.
Conclusion
The records deleted will be in high volume (millions of records)
This scenario does not require any synchronous behavior as the records should be deleted after 7 years.
Solution Approach
We need to use the asynchronous apex feature of Salesforce as the data deletion needs to happen in the backend without impacting any other logic.
We need to specifically use Batch Apex (Asynchronous Apex) because the requirement is of data cleaning which may be millions of records.
Lets learn more about a high-level overview of Asynchronous Apex features with use cases.
This is a scenario-based question. The scenario given in this question is:
A company needs to automatically delete sensitive information after seven years.
This could delete almost a million records every day.
Conclusion
The records deleted will be in high volume (millions of records)
This scenario does not require any synchronous behavior as the records should be deleted after 7 years.
Solution Approach
We need to use the asynchronous apex feature of Salesforce as the data deletion needs to happen in the backend without impacting any other logic.
We need to specifically use Batch Apex (Asynchronous Apex) because the requirement is of data cleaning which may be millions of records.
Lets learn more about a high-level overview of Asynchronous Apex features with use cases.
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and building addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth.
Which approach follows best practices and allows Universal Containers to switch vendors without updating the code to handle authentication?
Correct
This is a scenario-based question and is related to the authentication mechanism used in Salesforce. The scenario given in this question is:
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and building addresses are correct.
The current vendor uses basic password authentication.
Universal Containers might switch to a different vendor who uses OAuth.
That means Universal Containers may need to switch to a different vendor who uses OAuth so, which feature we can use in Salesforce supports different authentication like password authentication, OAuth 2.0, JWT etc.
As per Salesforce documentation, we can use Named Credential.
A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4.
You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level.
Screenshot Named Credential Setup
This is a scenario-based question and is related to the authentication mechanism used in Salesforce. The scenario given in this question is:
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and building addresses are correct.
The current vendor uses basic password authentication.
Universal Containers might switch to a different vendor who uses OAuth.
That means Universal Containers may need to switch to a different vendor who uses OAuth so, which feature we can use in Salesforce supports different authentication like password authentication, OAuth 2.0, JWT etc.
As per Salesforce documentation, we can use Named Credential.
A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4.
You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level.
Screenshot Named Credential Setup
This is a scenario-based question and is related to the authentication mechanism used in Salesforce. The scenario given in this question is:
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and building addresses are correct.
The current vendor uses basic password authentication.
Universal Containers might switch to a different vendor who uses OAuth.
That means Universal Containers may need to switch to a different vendor who uses OAuth so, which feature we can use in Salesforce supports different authentication like password authentication, OAuth 2.0, JWT etc.
As per Salesforce documentation, we can use Named Credential.
A named credential authentication protocol supports basic password authentication, OAuth 2.0, JWT, JWT Token Exchange, and AWS Signature Version 4.
You can set up each named credential to use an org-wide named principal or per-user authentication. A named principal applies the same credential or authentication configuration for the entire org, while per-user authentication provides access control at the individual user level.
Screenshot Named Credential Setup
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.
When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?
Correct
This is a scenario-based question that is related to implementing the partial page updates using .
The scenario given in this question is:
In Visualforce Page, there is an Industry select list.
When a user changes the value in the industry select list, the table of Accounts should be automatically updated based on the selected industry
To understand this, let‘s write some code. We have created an Apex Class and a Visualforce Page.
Screenshot Apex Class (controller)
This is a scenario-based question that is related to implementing the partial page updates using .
The scenario given in this question is:
In Visualforce Page, there is an Industry select list.
When a user changes the value in the industry select list, the table of Accounts should be automatically updated based on the selected industry
To understand this, let‘s write some code. We have created an Apex Class and a Visualforce Page.
Screenshot Apex Class (controller)
This is a scenario-based question that is related to implementing the partial page updates using .
The scenario given in this question is:
In Visualforce Page, there is an Industry select list.
When a user changes the value in the industry select list, the table of Accounts should be automatically updated based on the selected industry
To understand this, let‘s write some code. We have created an Apex Class and a Visualforce Page.
Screenshot Apex Class (controller)
Which two relationship queries use the proper syntax?
Choose 2 answers.
Correct
This question is related to the concept of Relationship Queries in Salesforce. Lets learn some basics about it.
Relationship Queries
Client applications need to be able to query for more than a single type of object at a time. SOQL provides syntax to support these types of queries, called relationship queries, against standard objects and custom objects.
There are two types of relationship queries:
Parent-to-child relationships
o This simply means we query to parent objects and also get child records.
Child-to-parent relationships
o This means we query to child and get parent fields.
Understanding Relationship Names
Parent-to-child and child-to-parent relationships exist between many types of objects. For example, an Account is a parent of Contact.
For child-to-parent relationships, the contact child object has a child-to-parent relationship to the Account object, so the value of the relationshipname in Contact is Account.
For parent-to-child relationships, the parent object has a name for the child relationship that is unique to the parent, the plural of the child object name. For example, Account has child relationships Contacts and has a relationshipName as Contacts.
Syntax child to parent Query
Specify these relationships directly in the SELECT, FROM, or WHERE clauses using the dot (.) operator.
SELECT Id, Name, Account.Name FROM Contact
Syntax parent to child
Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
SELECT Id, (SELECT LastName FROM Contacts) FROM Account
Now, coming back to the options given.
The below option is NOT CORRECT because this is a child-to-parent query having a child as Contact and Account as a parent and the relationshipName in Contact is Account but it uses Account__r.
SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r. Industry = Media
The below option is NOT CORRECT because this is a parent-to-child query having a child as a Contact and an Account as a parent. Account has child relationships Contacts and has a relationshipName as Contacts. But it uses Contacts__r
SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Name, (SELECT LastName FROM Contacts) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = Media
References: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm#sforce_api_calls_soql_relationships_understanding https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm#sforce_api_calls_soql_relationships_query_using
Incorrect
This question is related to the concept of Relationship Queries in Salesforce. Lets learn some basics about it.
Relationship Queries
Client applications need to be able to query for more than a single type of object at a time. SOQL provides syntax to support these types of queries, called relationship queries, against standard objects and custom objects.
There are two types of relationship queries:
Parent-to-child relationships
o This simply means we query to parent objects and also get child records.
Child-to-parent relationships
o This means we query to child and get parent fields.
Understanding Relationship Names
Parent-to-child and child-to-parent relationships exist between many types of objects. For example, an Account is a parent of Contact.
For child-to-parent relationships, the contact child object has a child-to-parent relationship to the Account object, so the value of the relationshipname in Contact is Account.
For parent-to-child relationships, the parent object has a name for the child relationship that is unique to the parent, the plural of the child object name. For example, Account has child relationships Contacts and has a relationshipName as Contacts.
Syntax child to parent Query
Specify these relationships directly in the SELECT, FROM, or WHERE clauses using the dot (.) operator.
SELECT Id, Name, Account.Name FROM Contact
Syntax parent to child
Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
SELECT Id, (SELECT LastName FROM Contacts) FROM Account
Now, coming back to the options given.
The below option is NOT CORRECT because this is a child-to-parent query having a child as Contact and Account as a parent and the relationshipName in Contact is Account but it uses Account__r.
SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r. Industry = Media
The below option is NOT CORRECT because this is a parent-to-child query having a child as a Contact and an Account as a parent. Account has child relationships Contacts and has a relationshipName as Contacts. But it uses Contacts__r
SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Name, (SELECT LastName FROM Contacts) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = Media
References: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm#sforce_api_calls_soql_relationships_understanding https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm#sforce_api_calls_soql_relationships_query_using
Unattempted
This question is related to the concept of Relationship Queries in Salesforce. Lets learn some basics about it.
Relationship Queries
Client applications need to be able to query for more than a single type of object at a time. SOQL provides syntax to support these types of queries, called relationship queries, against standard objects and custom objects.
There are two types of relationship queries:
Parent-to-child relationships
o This simply means we query to parent objects and also get child records.
Child-to-parent relationships
o This means we query to child and get parent fields.
Understanding Relationship Names
Parent-to-child and child-to-parent relationships exist between many types of objects. For example, an Account is a parent of Contact.
For child-to-parent relationships, the contact child object has a child-to-parent relationship to the Account object, so the value of the relationshipname in Contact is Account.
For parent-to-child relationships, the parent object has a name for the child relationship that is unique to the parent, the plural of the child object name. For example, Account has child relationships Contacts and has a relationshipName as Contacts.
Syntax child to parent Query
Specify these relationships directly in the SELECT, FROM, or WHERE clauses using the dot (.) operator.
SELECT Id, Name, Account.Name FROM Contact
Syntax parent to child
Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
SELECT Id, (SELECT LastName FROM Contacts) FROM Account
Now, coming back to the options given.
The below option is NOT CORRECT because this is a child-to-parent query having a child as Contact and Account as a parent and the relationshipName in Contact is Account but it uses Account__r.
SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r. Industry = Media
The below option is NOT CORRECT because this is a parent-to-child query having a child as a Contact and an Account as a parent. Account has child relationships Contacts and has a relationshipName as Contacts. But it uses Contacts__r
SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Name, (SELECT LastName FROM Contacts) FROM Account.
The below option is CORRECT as it uses correct relationshipName and syntax.
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = Media
References: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm#sforce_api_calls_soql_relationships_understanding https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm#sforce_api_calls_soql_relationships_query_using
Question 28 of 58
28. Question
An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate code coverage?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 29 of 58
29. Question
A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience. Given these requirements, what is the recommended solution to develop the application?
Correct
This is a scenario-based question related to the topic User Interface Development Considerations in Salesforce. The scenario given in this question is: There is a need to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular and must be made available in both Classic and Lightning Experience. The requirement is to choose the best / recommended solution to develop the application. As per Salesforce Documentation, Visualforce is conceptually similar to other page-centric technologies like PHP, ASP, JSP, and Ruby on Rails. Salesforces rich metadata infrastructure makes Visualforce a productive solution. Visualforce pages are just HTML pages with extra tags resolved by the server. As a result, you can use an empty Visualforce page as a container for a JavaScript application. In this scenario, you dont use Visualforce tags to build your user interface. Instead, you load your JavaScript application on an empty page. Then the user interface is generated on the client-side by the JavaScript application. These applications are generally referred to as single-page applications, or SPAs, and are often built using third-party frameworks like AngularJS or React. With this explanation, the correct answer is: Option Visualforce is correct because it can be used to develop page-centric applications & can be used as a container for your third-party framework, such as AngularJS or React, and your application. Reference: https://trailhead.salesforce.com/en/content/learn/modules/lex_dev_overview/lex_dev_overview_future
Incorrect
This is a scenario-based question related to the topic User Interface Development Considerations in Salesforce. The scenario given in this question is: There is a need to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular and must be made available in both Classic and Lightning Experience. The requirement is to choose the best / recommended solution to develop the application. As per Salesforce Documentation, Visualforce is conceptually similar to other page-centric technologies like PHP, ASP, JSP, and Ruby on Rails. Salesforces rich metadata infrastructure makes Visualforce a productive solution. Visualforce pages are just HTML pages with extra tags resolved by the server. As a result, you can use an empty Visualforce page as a container for a JavaScript application. In this scenario, you dont use Visualforce tags to build your user interface. Instead, you load your JavaScript application on an empty page. Then the user interface is generated on the client-side by the JavaScript application. These applications are generally referred to as single-page applications, or SPAs, and are often built using third-party frameworks like AngularJS or React. With this explanation, the correct answer is: Option Visualforce is correct because it can be used to develop page-centric applications & can be used as a container for your third-party framework, such as AngularJS or React, and your application. Reference: https://trailhead.salesforce.com/en/content/learn/modules/lex_dev_overview/lex_dev_overview_future
Unattempted
This is a scenario-based question related to the topic User Interface Development Considerations in Salesforce. The scenario given in this question is: There is a need to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular and must be made available in both Classic and Lightning Experience. The requirement is to choose the best / recommended solution to develop the application. As per Salesforce Documentation, Visualforce is conceptually similar to other page-centric technologies like PHP, ASP, JSP, and Ruby on Rails. Salesforces rich metadata infrastructure makes Visualforce a productive solution. Visualforce pages are just HTML pages with extra tags resolved by the server. As a result, you can use an empty Visualforce page as a container for a JavaScript application. In this scenario, you dont use Visualforce tags to build your user interface. Instead, you load your JavaScript application on an empty page. Then the user interface is generated on the client-side by the JavaScript application. These applications are generally referred to as single-page applications, or SPAs, and are often built using third-party frameworks like AngularJS or React. With this explanation, the correct answer is: Option Visualforce is correct because it can be used to develop page-centric applications & can be used as a container for your third-party framework, such as AngularJS or React, and your application. Reference: https://trailhead.salesforce.com/en/content/learn/modules/lex_dev_overview/lex_dev_overview_future
Question 30 of 58
30. Question
A developer created an Apex class that makes an outbound RESTful callout. The following class was created to ail send a fake response in Apex test methods.
Which method can be called to return this fake response in the test methods?
Correct
This question is related to Testing HTTP Callouts by Implementing the HttpCalloutMock interface. The scenario given in the question is:
The sample Apex Test code is given to create a fake response.
The ask in this question is:
Which method can be called to return this fake response in the test methods?
As per the Salesforce Document, once we have specified the values of the fake response, instruct the Apex runtime to send this fake response by calling Test.setMock in your test method. For the first argument, pass HttpCalloutMock.class, and for the second argument, pass a new instance of your interface implementation of HttpCalloutMock, as follows:
This question is related to Testing HTTP Callouts by Implementing the HttpCalloutMock interface. The scenario given in the question is:
The sample Apex Test code is given to create a fake response.
The ask in this question is:
Which method can be called to return this fake response in the test methods?
As per the Salesforce Document, once we have specified the values of the fake response, instruct the Apex runtime to send this fake response by calling Test.setMock in your test method. For the first argument, pass HttpCalloutMock.class, and for the second argument, pass a new instance of your interface implementation of HttpCalloutMock, as follows:
This question is related to Testing HTTP Callouts by Implementing the HttpCalloutMock interface. The scenario given in the question is:
The sample Apex Test code is given to create a fake response.
The ask in this question is:
Which method can be called to return this fake response in the test methods?
As per the Salesforce Document, once we have specified the values of the fake response, instruct the Apex runtime to send this fake response by calling Test.setMock in your test method. For the first argument, pass HttpCalloutMock.class, and for the second argument, pass a new instance of your interface implementation of HttpCalloutMock, as follows:
A company has reference data stored in multiple Custom Metadata records that represent default information for certain geographic regions. When a Contact is inserted, the default information should be set on the Contact from the Custom Metadata records based on the Contact‘s Address information. What is the optimal way to automate this?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 32 of 58
32. Question
A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. Which consideration should be checked to resolve the issue?
Correct
This question is related to Apex Test Class in Sandbox and Production. The scenario given in this question is: A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. The requirement is: Which consideration should be checked to resolve the issue? If we consider Point-2, it says No code or metadata changes have been actively made. Therefore, the below options are incorrect. Option Ensure Workflow Rules are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure Process Builder processes are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure the Apex Classes are on the same API version is not correct because it does not impact. Option Ensure the sandbox is on the same release as production is correct because once a new release comes, the best approach is to refresh the sandbox and test existing customizations against release features. So, it might be the reason that the Sandbox is refreshed and has a new release.
Incorrect
This question is related to Apex Test Class in Sandbox and Production. The scenario given in this question is: A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. The requirement is: Which consideration should be checked to resolve the issue? If we consider Point-2, it says No code or metadata changes have been actively made. Therefore, the below options are incorrect. Option Ensure Workflow Rules are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure Process Builder processes are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure the Apex Classes are on the same API version is not correct because it does not impact. Option Ensure the sandbox is on the same release as production is correct because once a new release comes, the best approach is to refresh the sandbox and test existing customizations against release features. So, it might be the reason that the Sandbox is refreshed and has a new release.
Unattempted
This question is related to Apex Test Class in Sandbox and Production. The scenario given in this question is: A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created. The requirement is: Which consideration should be checked to resolve the issue? If we consider Point-2, it says No code or metadata changes have been actively made. Therefore, the below options are incorrect. Option Ensure Workflow Rules are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure Process Builder processes are inactive is not correct because Apex Test should cover the scenarios which is mostly related to Apex Code and also it is said that No code or metadata changes have been actively made. Option Ensure the Apex Classes are on the same API version is not correct because it does not impact. Option Ensure the sandbox is on the same release as production is correct because once a new release comes, the best approach is to refresh the sandbox and test existing customizations against release features. So, it might be the reason that the Sandbox is refreshed and has a new release.
Question 33 of 58
33. Question
Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records: that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c Which two queries are optimized for large data volumes? Choose 2 answers.
Correct
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, the scenario given is Assume that there are more than 200,000 Account records. These records include soft-deleted records: that is, deleted records that are still in the Recycle Bin. there are two fields that are marked as External Id on the Account. o Customer_Number__c o ERP_Key__c The ask is: Which two queries are optimized for large data volumes? With this explanation, the correct answers are: The below Option is correct because the WHERE clause is on an indexed field (Id). SELECT Id FROM Account WHERE Id IN :aListVariable The below Option is correct because the field Customer_Number__c is selective. SELECT Id FROM Account WHERE Name != ‘ ‘ AND Customer_Number__c = ‘ValueA‘ Reference: https://help.salesforce.com/s/articleView?id=000325247&type=1
Incorrect
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, the scenario given is Assume that there are more than 200,000 Account records. These records include soft-deleted records: that is, deleted records that are still in the Recycle Bin. there are two fields that are marked as External Id on the Account. o Customer_Number__c o ERP_Key__c The ask is: Which two queries are optimized for large data volumes? With this explanation, the correct answers are: The below Option is correct because the WHERE clause is on an indexed field (Id). SELECT Id FROM Account WHERE Id IN :aListVariable The below Option is correct because the field Customer_Number__c is selective. SELECT Id FROM Account WHERE Name != ‘ ‘ AND Customer_Number__c = ‘ValueA‘ Reference: https://help.salesforce.com/s/articleView?id=000325247&type=1
Unattempted
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, the scenario given is Assume that there are more than 200,000 Account records. These records include soft-deleted records: that is, deleted records that are still in the Recycle Bin. there are two fields that are marked as External Id on the Account. o Customer_Number__c o ERP_Key__c The ask is: Which two queries are optimized for large data volumes? With this explanation, the correct answers are: The below Option is correct because the WHERE clause is on an indexed field (Id). SELECT Id FROM Account WHERE Id IN :aListVariable The below Option is correct because the field Customer_Number__c is selective. SELECT Id FROM Account WHERE Name != ‘ ‘ AND Customer_Number__c = ‘ValueA‘ Reference: https://help.salesforce.com/s/articleView?id=000325247&type=1
Question 34 of 58
34. Question
A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all workflow rules have been fired.
What is the optimal way to accomplish this?
Correct
This is a scenario-based question that is related to Sending Emails to customers. The scenario given in this question is:
There is a need to automatically send an email to the customer when an Opportunity stage changes.
The solution must scale to allow for 10,000 emails per day.
The criteria to send the email should be evaluated after all workflow rules have been fired.
Please Note: The important part here is The criteria to send the email should be evaluated after all workflow rules have fired. That means this is related to Order of Execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT.
Salesforce performs the following events in the below order.
Now coming back to the question, it says that The criteria to send the email should be evaluated after all workflow rules have fired. If we see the Order of Execution, the Apex Trigger and workflow rule fire before Process.
With this explanation, the correct answer is
Option Use an Email Alert with Process Builder. is correct
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Incorrect
This is a scenario-based question that is related to Sending Emails to customers. The scenario given in this question is:
There is a need to automatically send an email to the customer when an Opportunity stage changes.
The solution must scale to allow for 10,000 emails per day.
The criteria to send the email should be evaluated after all workflow rules have been fired.
Please Note: The important part here is The criteria to send the email should be evaluated after all workflow rules have fired. That means this is related to Order of Execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT.
Salesforce performs the following events in the below order.
Now coming back to the question, it says that The criteria to send the email should be evaluated after all workflow rules have fired. If we see the Order of Execution, the Apex Trigger and workflow rule fire before Process.
With this explanation, the correct answer is
Option Use an Email Alert with Process Builder. is correct
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Unattempted
This is a scenario-based question that is related to Sending Emails to customers. The scenario given in this question is:
There is a need to automatically send an email to the customer when an Opportunity stage changes.
The solution must scale to allow for 10,000 emails per day.
The criteria to send the email should be evaluated after all workflow rules have been fired.
Please Note: The important part here is The criteria to send the email should be evaluated after all workflow rules have fired. That means this is related to Order of Execution in Salesforce.
Order of Execution in Salesforce
A set of rules that describe the path a record takes through all automation and the events that happen from SAVE to COMMIT.
Salesforce performs the following events in the below order.
Now coming back to the question, it says that The criteria to send the email should be evaluated after all workflow rules have fired. If we see the Order of Execution, the Apex Trigger and workflow rule fire before Process.
With this explanation, the correct answer is
Option Use an Email Alert with Process Builder. is correct
Reference: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Question 35 of 58
35. Question
A company wants to build a custom Aura component that displays a specified Account Field Set and that can only be added to the Account record page.
Which design resource configuration should be used?
Correct
This question is related to Aura Component Bundle Design Resources.
Lets learn the basics about Design resources:
Use a design resource to control which attributes are exposed to builder tools like the Lightning App Builder, Experience Builder, or Flow Builder. A design resource lives in the same folder as your .cmp resource and describes the design-time behavior of the Aura componentinformation that visual tools need to display the component in a page or app.
Screenshot Aura Component (.cmp file)
Screenshot Aura Component (.design file)
design:attribute
To make an Aura component attribute available for admins to edit in tools such as the App Builder, add a design:attribute node for the attribute into the design resource.
and
Use these tag sets to restrict your component to one or more objects.
Now, coming back to the question it says
To displays a specified Account Field Set
o For this, we need to use
To restrict the component to the Account record page.
o For this, we need to use Account
With this explanation, below is the correct answer because it uses and Account
This question is related to Aura Component Bundle Design Resources.
Lets learn the basics about Design resources:
Use a design resource to control which attributes are exposed to builder tools like the Lightning App Builder, Experience Builder, or Flow Builder. A design resource lives in the same folder as your .cmp resource and describes the design-time behavior of the Aura componentinformation that visual tools need to display the component in a page or app.
Screenshot Aura Component (.cmp file)
Screenshot Aura Component (.design file)
design:attribute
To make an Aura component attribute available for admins to edit in tools such as the App Builder, add a design:attribute node for the attribute into the design resource.
and
Use these tag sets to restrict your component to one or more objects.
Now, coming back to the question it says
To displays a specified Account Field Set
o For this, we need to use
To restrict the component to the Account record page.
o For this, we need to use Account
With this explanation, below is the correct answer because it uses and Account
This question is related to Aura Component Bundle Design Resources.
Lets learn the basics about Design resources:
Use a design resource to control which attributes are exposed to builder tools like the Lightning App Builder, Experience Builder, or Flow Builder. A design resource lives in the same folder as your .cmp resource and describes the design-time behavior of the Aura componentinformation that visual tools need to display the component in a page or app.
Screenshot Aura Component (.cmp file)
Screenshot Aura Component (.design file)
design:attribute
To make an Aura component attribute available for admins to edit in tools such as the App Builder, add a design:attribute node for the attribute into the design resource.
and
Use these tag sets to restrict your component to one or more objects.
Now, coming back to the question it says
To displays a specified Account Field Set
o For this, we need to use
To restrict the component to the Account record page.
o For this, we need to use Account
With this explanation, below is the correct answer because it uses and Account
A company uses its own custom-built enterprise resource planning (ERP) system to handle order management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask about their shipment, the Sales Rep can advise the customer about the order‘s status and tracking number if it is already shipped. Which two methods can make this ERP order data visible in Salesforce? Choose 2 answers.
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 37 of 58
37. Question
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunitys Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?
Correct
This is a scenario-based question related to the concept of Apex Trigger and Test Class. The scenario given in this question is:
There is an Apex Trigger on Opportunity that will update a custom Last Sold Date field on the Opportunitys Account whenever an Opportunity is closed.
There is an Apex Test class written to cover this scenario.
The ask in this question is:
In the Apex Test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion?
Lets recreate the Scenario.
Screenshot Apex Trigger
Screenshot Apex Trigger Test
Screenshot Error while running above Test Class
As per the scenario given in the question, the assertion is getting failed with error: Expected = 2022-02-19 and Actual = null for Last Sold Field on Account.
But as per the Trigger Code, we know that when the Opportunity Stage is updated to Closed, the Last Sold Date field on Account should be updated to TODAYs date but WHY its null.
Please Note: In the Apex Test Class, we are using Account acct to check the Last Sold Date after Opportunity is updated. But the correct approach is we should re-query the Account record after the Opportunity record is updated.
Screenshot Correct Apex Test Class
This is a scenario-based question related to the concept of Apex Trigger and Test Class. The scenario given in this question is:
There is an Apex Trigger on Opportunity that will update a custom Last Sold Date field on the Opportunitys Account whenever an Opportunity is closed.
There is an Apex Test class written to cover this scenario.
The ask in this question is:
In the Apex Test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion?
Lets recreate the Scenario.
Screenshot Apex Trigger
Screenshot Apex Trigger Test
Screenshot Error while running above Test Class
As per the scenario given in the question, the assertion is getting failed with error: Expected = 2022-02-19 and Actual = null for Last Sold Field on Account.
But as per the Trigger Code, we know that when the Opportunity Stage is updated to Closed, the Last Sold Date field on Account should be updated to TODAYs date but WHY its null.
Please Note: In the Apex Test Class, we are using Account acct to check the Last Sold Date after Opportunity is updated. But the correct approach is we should re-query the Account record after the Opportunity record is updated.
Screenshot Correct Apex Test Class
This is a scenario-based question related to the concept of Apex Trigger and Test Class. The scenario given in this question is:
There is an Apex Trigger on Opportunity that will update a custom Last Sold Date field on the Opportunitys Account whenever an Opportunity is closed.
There is an Apex Test class written to cover this scenario.
The ask in this question is:
In the Apex Test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion?
Lets recreate the Scenario.
Screenshot Apex Trigger
Screenshot Apex Trigger Test
Screenshot Error while running above Test Class
As per the scenario given in the question, the assertion is getting failed with error: Expected = 2022-02-19 and Actual = null for Last Sold Field on Account.
But as per the Trigger Code, we know that when the Opportunity Stage is updated to Closed, the Last Sold Date field on Account should be updated to TODAYs date but WHY its null.
Please Note: In the Apex Test Class, we are using Account acct to check the Last Sold Date after Opportunity is updated. But the correct approach is we should re-query the Account record after the Opportunity record is updated.
Screenshot Correct Apex Test Class
Users complain that a page is very slow to respond. Upon investigation, the query below is found to perform slowly. SELECT Id, Name FROM Contact WHERE CustomField_c = null; Which two actions can a developer take to improve performance? Choose 2 answers.
Correct
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, The Query given is: SELECT Id, Name FROM Contact WHERE CustomField_c = null; The ask is how to improve the performance to Query. The correct answers are: Option Make the CustomField__c field an External ID is correct because we can define the custom index field by making it External Id. Option Make the field CustomerField__c required because Salesforce field indexes do not include nulls is correct. References: https://help.salesforce.com/s/articleView?id=000325247&type=1 https://developer.salesforce.com/docs/atlas.en-us.228.0.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_case_studies_indexing_with_nulls.htm PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Incorrect
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, The Query given is: SELECT Id, Name FROM Contact WHERE CustomField_c = null; The ask is how to improve the performance to Query. The correct answers are: Option Make the CustomField__c field an External ID is correct because we can define the custom index field by making it External Id. Option Make the field CustomerField__c required because Salesforce field indexes do not include nulls is correct. References: https://help.salesforce.com/s/articleView?id=000325247&type=1 https://developer.salesforce.com/docs/atlas.en-us.228.0.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_case_studies_indexing_with_nulls.htm PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Unattempted
This question is related to the concept of Selective Queries in Salesforce. First of all, lets learn about few concepts. Index Fields in Salesforce In the modern cloud application with a large data set like Salesforce, indexing is very important to allow an application to search and return results to users at a minimum time and cost. There are 2 types of indexes in Salesforce: Standard Index Custom Index Salesforce maintains indexes on the following fields for most objects: Salesforce record ID RecordTypeId Division CreatedDate Systemmodstamp (LastModifiedDate) Name Email (for contacts and leads) Lookups and master-detail relationship Salesforce administrator can define a custom index field by making by making the field as External ID or unique field for the following field type: Number Auto-number Text Email Selective SOQL Queries: SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold. Now, coming back to the question, The Query given is: SELECT Id, Name FROM Contact WHERE CustomField_c = null; The ask is how to improve the performance to Query. The correct answers are: Option Make the CustomField__c field an External ID is correct because we can define the custom index field by making it External Id. Option Make the field CustomerField__c required because Salesforce field indexes do not include nulls is correct. References: https://help.salesforce.com/s/articleView?id=000325247&type=1 https://developer.salesforce.com/docs/atlas.en-us.228.0.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_case_studies_indexing_with_nulls.htm PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Question 39 of 58
39. Question
A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that are recently added for one department suddenly disappear without warning. Also, Workflow that once sent emails and created tasks no longer do so. Which two statements are true regarding these issues and resolution? Choose 2 answers.
Correct
This is a scenario-based question related to deploying components from Sandbox to Production. The scenario given in this question is: In a company, there are different departments and each department has its own Salesforce administrator. Each administrator has its own Sandbox to test the changes done. There are below few issues they are noticing: o Fields that are recently added for one department suddenly disappear without warning. o Workflows that once sent emails and created tasks no longer do so. The ask is: What is the root cause of the above issues? From the above scenario, we can see that each administrator has its own Sandbox and they can deploy components from Sandbox to Production. In this situation, there are more chances that the same component can be overlapped. For example: Lets assume. Sandbox-1 having Case Page Layout having a field Reason Sandbox-2 having Case Page Layout does not have field Reason Now, if the Case Page Layout is deployed from Sandbox-1 to Production. Therefore, the Case Page Layout in Production will have the field Reason But, after that if Case Page Layout does not have the field Reason is deployed from Sandbox-2 to Production. It will override the Case Page Layout in Production. Therefore, as per best practice: A Sandbox should be created to use as a unified testing environment and all the production deployment should happen from the unified Sandbox. With this explanation, the correct answer is: Option A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production is correct. Option The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production is correct Reference: https://help.salesforce.com/s/articleView?id=000338970&type=1
Incorrect
This is a scenario-based question related to deploying components from Sandbox to Production. The scenario given in this question is: In a company, there are different departments and each department has its own Salesforce administrator. Each administrator has its own Sandbox to test the changes done. There are below few issues they are noticing: o Fields that are recently added for one department suddenly disappear without warning. o Workflows that once sent emails and created tasks no longer do so. The ask is: What is the root cause of the above issues? From the above scenario, we can see that each administrator has its own Sandbox and they can deploy components from Sandbox to Production. In this situation, there are more chances that the same component can be overlapped. For example: Lets assume. Sandbox-1 having Case Page Layout having a field Reason Sandbox-2 having Case Page Layout does not have field Reason Now, if the Case Page Layout is deployed from Sandbox-1 to Production. Therefore, the Case Page Layout in Production will have the field Reason But, after that if Case Page Layout does not have the field Reason is deployed from Sandbox-2 to Production. It will override the Case Page Layout in Production. Therefore, as per best practice: A Sandbox should be created to use as a unified testing environment and all the production deployment should happen from the unified Sandbox. With this explanation, the correct answer is: Option A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production is correct. Option The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production is correct Reference: https://help.salesforce.com/s/articleView?id=000338970&type=1
Unattempted
This is a scenario-based question related to deploying components from Sandbox to Production. The scenario given in this question is: In a company, there are different departments and each department has its own Salesforce administrator. Each administrator has its own Sandbox to test the changes done. There are below few issues they are noticing: o Fields that are recently added for one department suddenly disappear without warning. o Workflows that once sent emails and created tasks no longer do so. The ask is: What is the root cause of the above issues? From the above scenario, we can see that each administrator has its own Sandbox and they can deploy components from Sandbox to Production. In this situation, there are more chances that the same component can be overlapped. For example: Lets assume. Sandbox-1 having Case Page Layout having a field Reason Sandbox-2 having Case Page Layout does not have field Reason Now, if the Case Page Layout is deployed from Sandbox-1 to Production. Therefore, the Case Page Layout in Production will have the field Reason But, after that if Case Page Layout does not have the field Reason is deployed from Sandbox-2 to Production. It will override the Case Page Layout in Production. Therefore, as per best practice: A Sandbox should be created to use as a unified testing environment and all the production deployment should happen from the unified Sandbox. With this explanation, the correct answer is: Option A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production is correct. Option The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production is correct Reference: https://help.salesforce.com/s/articleView?id=000338970&type=1
Question 40 of 58
40. Question
A developer wrote an Apex class to make several callouts to an external system. If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?
Correct
An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services). Please Note: Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses. If the callout specifies a named credential as the endpoint, you dont need to configure remote site settings. A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. About Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your code doesnt have to. You can also skip remote site settings, which are otherwise required for callouts to external sites, for the site defined in the named credential. Named Credentials also include an OutboundNetworkConnection field that you can use to route callouts through a private connection. By separating the endpoint URL and authentication from the callout definition, named credentials make callouts easier to maintain. For example, if an endpoint URL changes, you update only the named credential. All callouts that reference the named credential simply continue to work. With this explanation, the correct answer is Named Credentials. References: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts.htm https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm
Incorrect
An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services). Please Note: Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses. If the callout specifies a named credential as the endpoint, you dont need to configure remote site settings. A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. About Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your code doesnt have to. You can also skip remote site settings, which are otherwise required for callouts to external sites, for the site defined in the named credential. Named Credentials also include an OutboundNetworkConnection field that you can use to route callouts through a private connection. By separating the endpoint URL and authentication from the callout definition, named credentials make callouts easier to maintain. For example, if an endpoint URL changes, you update only the named credential. All callouts that reference the named credential simply continue to work. With this explanation, the correct answer is Named Credentials. References: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts.htm https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm
Unattempted
An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services). Please Note: Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses. If the callout specifies a named credential as the endpoint, you dont need to configure remote site settings. A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. About Named Credentials A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your code doesnt have to. You can also skip remote site settings, which are otherwise required for callouts to external sites, for the site defined in the named credential. Named Credentials also include an OutboundNetworkConnection field that you can use to route callouts through a private connection. By separating the endpoint URL and authentication from the callout definition, named credentials make callouts easier to maintain. For example, if an endpoint URL changes, you update only the named credential. All callouts that reference the named credential simply continue to work. With this explanation, the correct answer is Named Credentials. References: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts.htm https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm
Question 41 of 58
41. Question
Users report that a button on a custom Lightning web component is not working. However, there are no other details provided.
What should the developer use to ensure error messages are properly displayed?
Correct
This question is related to Lightning Web Component. The scenario given in this question is:
There is a button on the custom Lightning Web Component but its not working.
There are no other details provided.
The ask in this question is:
What should the developer use to ensure that error messages are properly displayed.
That means, whenever an error occurred, we need to show that error to the user.
The correct answer to this question is Add JavaScript and HTML to display an error message. because to display an error message in Lightning Web Component, we can add logic in to the javascript file.
That means, the js file can collect the error and display it. There are several ways to achieve this. One of the ways is to use the toast component.
Lets see an example.
Screenshot LWC .html file
This question is related to Lightning Web Component. The scenario given in this question is:
There is a button on the custom Lightning Web Component but its not working.
There are no other details provided.
The ask in this question is:
What should the developer use to ensure that error messages are properly displayed.
That means, whenever an error occurred, we need to show that error to the user.
The correct answer to this question is Add JavaScript and HTML to display an error message. because to display an error message in Lightning Web Component, we can add logic in to the javascript file.
That means, the js file can collect the error and display it. There are several ways to achieve this. One of the ways is to use the toast component.
Lets see an example.
Screenshot LWC .html file
This question is related to Lightning Web Component. The scenario given in this question is:
There is a button on the custom Lightning Web Component but its not working.
There are no other details provided.
The ask in this question is:
What should the developer use to ensure that error messages are properly displayed.
That means, whenever an error occurred, we need to show that error to the user.
The correct answer to this question is Add JavaScript and HTML to display an error message. because to display an error message in Lightning Web Component, we can add logic in to the javascript file.
That means, the js file can collect the error and display it. There are several ways to achieve this. One of the ways is to use the toast component.
Lets see an example.
Screenshot LWC .html file
A page throws an Attempt to dereference a null object error for a Contact. What change in the controller will fix the error?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 43 of 58
43. Question
How can a developer efficiently incorporate multiple JavaScript libraries in a Lightning component?
Correct
This question is related to using an external JavaScript library in Lightning Component. As per Salesforce documentation, To reference a JavaScript library, upload it as a static resource and use a tag in your .cmp or .app markup.
Therefore, there are two steps:
1. Load the external JavaScript library in the static resource.
2. Use tag to load the JavaScript library in the lighting Component as shown below:
Screenshot Use the join operator to include multiple libraries in Lightning Component
With this explanation, the correct answer is: Join multiple assets from a static resource because we need to use the join operator to incorporate multiple JavaScript libraries in a Lightning component.
This question is related to using an external JavaScript library in Lightning Component. As per Salesforce documentation, To reference a JavaScript library, upload it as a static resource and use a tag in your .cmp or .app markup.
Therefore, there are two steps:
1. Load the external JavaScript library in the static resource.
2. Use tag to load the JavaScript library in the lighting Component as shown below:
Screenshot Use the join operator to include multiple libraries in Lightning Component
With this explanation, the correct answer is: Join multiple assets from a static resource because we need to use the join operator to incorporate multiple JavaScript libraries in a Lightning component.
This question is related to using an external JavaScript library in Lightning Component. As per Salesforce documentation, To reference a JavaScript library, upload it as a static resource and use a tag in your .cmp or .app markup.
Therefore, there are two steps:
1. Load the external JavaScript library in the static resource.
2. Use tag to load the JavaScript library in the lighting Component as shown below:
Screenshot Use the join operator to include multiple libraries in Lightning Component
With this explanation, the correct answer is: Join multiple assets from a static resource because we need to use the join operator to incorporate multiple JavaScript libraries in a Lightning component.
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted if they have not already been set. What is the optimal way to achieve this?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 45 of 58
45. Question
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunitys Account?
[Please pardon any typo in the answer option. As it is not allowed to include images in the answer option please visit the explanation part for the exact code.]
Correct
This is a scenario-based question that is related to the SOQL query in Salesforce. The scenario given in this question is:
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunitys Account
Please Note:
In Salesforce, contact records do not have a direct relationship with Opportunities.
Opportunities have a relationship with an Account record, and the Account has a relationship with Contacts yet, no direct relationship.
Screenshot Relationship between Contact, Account, and Opportunity
Lets check the given options.
The below Option is NOT CORRECT because there is no direct relation between Contact and Opportunity. Therefore, we can not have ContactId on the Opportunity record.
The below option is NOT CORRECT because opportunityList.AccountId is invalid.
\
The below option is CORRECT because it uses the correct approach by querying parent-to-child, which are almost always one-to-many. Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
Note that for standard object subqueries, you should specify the plural name of the object as that is the name of the relationship for each object.
1. Collecting AccountId in a collection using Set
2. Querying Account with Contact using Set of AccounId
3. Adding contacts to a List named as ContactList
This is a scenario-based question that is related to the SOQL query in Salesforce. The scenario given in this question is:
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunitys Account
Please Note:
In Salesforce, contact records do not have a direct relationship with Opportunities.
Opportunities have a relationship with an Account record, and the Account has a relationship with Contacts yet, no direct relationship.
Screenshot Relationship between Contact, Account, and Opportunity
Lets check the given options.
The below Option is NOT CORRECT because there is no direct relation between Contact and Opportunity. Therefore, we can not have ContactId on the Opportunity record.
The below option is NOT CORRECT because opportunityList.AccountId is invalid.
\
The below option is CORRECT because it uses the correct approach by querying parent-to-child, which are almost always one-to-many. Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
Note that for standard object subqueries, you should specify the plural name of the object as that is the name of the relationship for each object.
1. Collecting AccountId in a collection using Set
2. Querying Account with Contact using Set of AccounId
3. Adding contacts to a List named as ContactList
This is a scenario-based question that is related to the SOQL query in Salesforce. The scenario given in this question is:
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunitys Account
Please Note:
In Salesforce, contact records do not have a direct relationship with Opportunities.
Opportunities have a relationship with an Account record, and the Account has a relationship with Contacts yet, no direct relationship.
Screenshot Relationship between Contact, Account, and Opportunity
Lets check the given options.
The below Option is NOT CORRECT because there is no direct relation between Contact and Opportunity. Therefore, we can not have ContactId on the Opportunity record.
The below option is NOT CORRECT because opportunityList.AccountId is invalid.
\
The below option is CORRECT because it uses the correct approach by querying parent-to-child, which are almost always one-to-many. Specify these relationships using a subquery (enclosed in parentheses), where the initial member of the FROM clause in the subquery is related to the initial member of the outer query FROM clause.
Note that for standard object subqueries, you should specify the plural name of the object as that is the name of the relationship for each object.
1. Collecting AccountId in a collection using Set
2. Querying Account with Contact using Set of AccounId
3. Adding contacts to a List named as ContactList
A developer is integrating with legacy on-premise SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?
Correct
This question is related to integrating the legacy systems with Salesforce. The ask in this question is “what should the developer use to ensure the data being integrated is matched to the right records in Salesforce”?
That means this scenario is all ensuring record matching so no duplicate records are inserted/updated.
This can be achieved by using the “External Id Field”.
The External ID field allows you to store unique record IDs from an external system, typically for integration purposes. For example, if we have a legacy system that needs to load/update data in Salesforce may reference these external records in Salesforce using unique Ids from Legacy system records.
To enable the External ID flag for a field:
Navigate to the object‘s field list
In Classic, go to Setup | Create | Objects | <object name> | Fields
In Lightning Experience, go to Setup | Object Manager | <object name> | Fields & Relationships.
Then, click Edit next to the field name to enable the External ID checkbox.
Screenshot – To make a field as External Id
With this explanation, the correct answer is “External Id field”
This question is related to integrating the legacy systems with Salesforce. The ask in this question is “what should the developer use to ensure the data being integrated is matched to the right records in Salesforce”?
That means this scenario is all ensuring record matching so no duplicate records are inserted/updated.
This can be achieved by using the “External Id Field”.
The External ID field allows you to store unique record IDs from an external system, typically for integration purposes. For example, if we have a legacy system that needs to load/update data in Salesforce may reference these external records in Salesforce using unique Ids from Legacy system records.
To enable the External ID flag for a field:
Navigate to the object‘s field list
In Classic, go to Setup | Create | Objects | <object name> | Fields
In Lightning Experience, go to Setup | Object Manager | <object name> | Fields & Relationships.
Then, click Edit next to the field name to enable the External ID checkbox.
Screenshot – To make a field as External Id
With this explanation, the correct answer is “External Id field”
This question is related to integrating the legacy systems with Salesforce. The ask in this question is “what should the developer use to ensure the data being integrated is matched to the right records in Salesforce”?
That means this scenario is all ensuring record matching so no duplicate records are inserted/updated.
This can be achieved by using the “External Id Field”.
The External ID field allows you to store unique record IDs from an external system, typically for integration purposes. For example, if we have a legacy system that needs to load/update data in Salesforce may reference these external records in Salesforce using unique Ids from Legacy system records.
To enable the External ID flag for a field:
Navigate to the object‘s field list
In Classic, go to Setup | Create | Objects | <object name> | Fields
In Lightning Experience, go to Setup | Object Manager | <object name> | Fields & Relationships.
Then, click Edit next to the field name to enable the External ID checkbox.
Screenshot – To make a field as External Id
With this explanation, the correct answer is “External Id field”
Refer to the following code snippets:
MyOpportunities.js
OpportunityController.cls
A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: Error retrieving data.
Which modification should be implemented to the Apex class to overcome the issue?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 48 of 58
48. Question
Ursa Major Solar (UMS) needs to integrate with a Heroku service that resizes product images submitted by users. What are two alternatives to implement the integration and protect against malicious calls to the Heroku app‘s endpoint? Choose 2 answers.
Correct
This is a scenario-based question that is related to Salesforce & Heroku Integration. The scenario given in this question is: Ursa Major Solar (UMS) needs to integrate with a Heroku service that resizes product images submitted by users. The ask in this question is: What are the ways to implement the integration and protect against malicious calls to the Heroku app‘s endpoint. As per Salesforce Documentation, there are two primary methods to call a Heroku app based on an event in Salesforce: Workflow outbound messages o A workflow outbound message declaratively makes a SOAP call. o While configuring outbound message, if we select Send Session Id the Heroku app can use that token to make REST API calls on the users behalf. If you don‘t send the session ID. there‘s no way to check that the request was valid or protect against malicious calls to your Heroku apps API endpoint. Apex HTTP callouts o An Apex HTTP callout programmatically makes a REST call to a Heroku app. o With Apex triggers, you can use some form of pre-shared key to authenticate requests, avoiding the potential for malicious requests. You can also have the payload include a session ID to let the Heroku app make REST API requests back to Salesforce to fetch or update data. With this explanation, the correct answers are: Option Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce is correct. Option Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key, so that the Heroku app can authenticate requests and store the resized images in Salesforce is correct. Trailhead Module: https://trailhead.salesforce.com/en/content/learn/modules/salesforce_heroku_integration/callouts_workflow_with_heroku PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Incorrect
This is a scenario-based question that is related to Salesforce & Heroku Integration. The scenario given in this question is: Ursa Major Solar (UMS) needs to integrate with a Heroku service that resizes product images submitted by users. The ask in this question is: What are the ways to implement the integration and protect against malicious calls to the Heroku app‘s endpoint. As per Salesforce Documentation, there are two primary methods to call a Heroku app based on an event in Salesforce: Workflow outbound messages o A workflow outbound message declaratively makes a SOAP call. o While configuring outbound message, if we select Send Session Id the Heroku app can use that token to make REST API calls on the users behalf. If you don‘t send the session ID. there‘s no way to check that the request was valid or protect against malicious calls to your Heroku apps API endpoint. Apex HTTP callouts o An Apex HTTP callout programmatically makes a REST call to a Heroku app. o With Apex triggers, you can use some form of pre-shared key to authenticate requests, avoiding the potential for malicious requests. You can also have the payload include a session ID to let the Heroku app make REST API requests back to Salesforce to fetch or update data. With this explanation, the correct answers are: Option Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce is correct. Option Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key, so that the Heroku app can authenticate requests and store the resized images in Salesforce is correct. Trailhead Module: https://trailhead.salesforce.com/en/content/learn/modules/salesforce_heroku_integration/callouts_workflow_with_heroku PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Unattempted
This is a scenario-based question that is related to Salesforce & Heroku Integration. The scenario given in this question is: Ursa Major Solar (UMS) needs to integrate with a Heroku service that resizes product images submitted by users. The ask in this question is: What are the ways to implement the integration and protect against malicious calls to the Heroku app‘s endpoint. As per Salesforce Documentation, there are two primary methods to call a Heroku app based on an event in Salesforce: Workflow outbound messages o A workflow outbound message declaratively makes a SOAP call. o While configuring outbound message, if we select Send Session Id the Heroku app can use that token to make REST API calls on the users behalf. If you don‘t send the session ID. there‘s no way to check that the request was valid or protect against malicious calls to your Heroku apps API endpoint. Apex HTTP callouts o An Apex HTTP callout programmatically makes a REST call to a Heroku app. o With Apex triggers, you can use some form of pre-shared key to authenticate requests, avoiding the potential for malicious requests. You can also have the payload include a session ID to let the Heroku app make REST API requests back to Salesforce to fetch or update data. With this explanation, the correct answers are: Option Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce is correct. Option Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key, so that the Heroku app can authenticate requests and store the resized images in Salesforce is correct. Trailhead Module: https://trailhead.salesforce.com/en/content/learn/modules/salesforce_heroku_integration/callouts_workflow_with_heroku PD2 Trail Mix: https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-platform-developer-ii-credential
Question 49 of 58
49. Question
An Aura component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.
How should a developer change the component to be responsive for mobile and tablet devices?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 50 of 58
50. Question
A company accepts orders for customers in their Enterprise Resource Planning (ERP) system that must be integrated into Salesforce as Order_c records with a lookup field to Account. The Account object has an external ID field, ERP_Customer_ID_c. What should the integration use to create new Order_c records that will automatically be related to the correct Account?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 51 of 58
51. Question
A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user‘s input.
When the search is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has been completed?
Correct
This question is related to Component Event and specifically about how to fire an event in Aura Component. The scenario given in this question is:
When the search is completed, a searchComplete event is fired.
While firing the event, the results put in a results attribute of the event.
The ask is:
What is the optimal code that should be added to fire the event when the search has been completed?
As per Salesforce documentation, a Component event to communicate data to another component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event.
To fire a component event, there are two steps:
1. Register an event
A component registers that it may fire an event by using in its markup. For example:
2. Fire an event
To get a reference to a component event in JavaScript, use cmp.getEvent(“evtName“) where evtName matches the name attribute in .
With this explanation, coming back to the options given:
Below is the correct answer because it uses getEvent() to get the reference of this component & also it uses the correct syntax to pass parameters to the event.
This question is related to Component Event and specifically about how to fire an event in Aura Component. The scenario given in this question is:
When the search is completed, a searchComplete event is fired.
While firing the event, the results put in a results attribute of the event.
The ask is:
What is the optimal code that should be added to fire the event when the search has been completed?
As per Salesforce documentation, a Component event to communicate data to another component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event.
To fire a component event, there are two steps:
1. Register an event
A component registers that it may fire an event by using in its markup. For example:
2. Fire an event
To get a reference to a component event in JavaScript, use cmp.getEvent(“evtName“) where evtName matches the name attribute in .
With this explanation, coming back to the options given:
Below is the correct answer because it uses getEvent() to get the reference of this component & also it uses the correct syntax to pass parameters to the event.
This question is related to Component Event and specifically about how to fire an event in Aura Component. The scenario given in this question is:
When the search is completed, a searchComplete event is fired.
While firing the event, the results put in a results attribute of the event.
The ask is:
What is the optimal code that should be added to fire the event when the search has been completed?
As per Salesforce documentation, a Component event to communicate data to another component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event.
To fire a component event, there are two steps:
1. Register an event
A component registers that it may fire an event by using in its markup. For example:
2. Fire an event
To get a reference to a component event in JavaScript, use cmp.getEvent(“evtName“) where evtName matches the name attribute in .
With this explanation, coming back to the options given:
Below is the correct answer because it uses getEvent() to get the reference of this component & also it uses the correct syntax to pass parameters to the event.
Universal Containers implements a private sharing model for the Convention_Attendee__c custom object. As part of a new quality assurance effort, the company created an Event_Reviewer__c user lookup field on the object. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?
Correct
This is a scenario-based question that is related to Sharing a record using Apex.
The scenario given in this question is:
There is a private sharing model for the Convention_Attendee__c custom object.
o Please Note: Since the sharing model is private. The Non Owner should not be able to view the Convention_Attendee__c custom object record.
There is a field Event_Reviewer__c on the custom object having lookup to the User.
Requirement
Event Reviewer to automatically gain Read/Write access to every record they are assigned to. That means, when the record of Convention Attendee custom object is created, the associated user should also get the Read/Write access.
Criteria-Based Sharing Rules
A criteria-based sharing rule determines with whom to share records based on field values. But in the scenario given in this question, the criteria is not universal so we can not use it. Therefore we need to use Apex.
Sharing a Record Using Apex
To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. All custom object sharing objects are named as follows:
Name of custom object = MyCustomObject
Name of share object = MyCustomObject__Share
Every share object has the following properties:
Now, coming back to the question:
Since the custom object name is Convention_Attendee__c, the share object will be created as Convention_Attendee__share because the Organization-Wide Default sharing setting was set to private.
From the above table, we know that to create a record for the Convention_Attendee__share object, we need to assign ParentId, which is the Id of the record being shared. (Id of Convention_Attendee__c record in this scenario)
Now, coming back to the options given, the correct answer is:
Option Create an After-Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is correct because we need to Set the ID of the record being shared which we can only have in After Trigger Context.
Option Create a Before Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is not correct in Before Trigger, we do not have the Id of record being shared.
Reference & code example: https://developer.salesforce.com/docs/atlas.en-us.204.0.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm
Incorrect
This is a scenario-based question that is related to Sharing a record using Apex.
The scenario given in this question is:
There is a private sharing model for the Convention_Attendee__c custom object.
o Please Note: Since the sharing model is private. The Non Owner should not be able to view the Convention_Attendee__c custom object record.
There is a field Event_Reviewer__c on the custom object having lookup to the User.
Requirement
Event Reviewer to automatically gain Read/Write access to every record they are assigned to. That means, when the record of Convention Attendee custom object is created, the associated user should also get the Read/Write access.
Criteria-Based Sharing Rules
A criteria-based sharing rule determines with whom to share records based on field values. But in the scenario given in this question, the criteria is not universal so we can not use it. Therefore we need to use Apex.
Sharing a Record Using Apex
To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. All custom object sharing objects are named as follows:
Name of custom object = MyCustomObject
Name of share object = MyCustomObject__Share
Every share object has the following properties:
Now, coming back to the question:
Since the custom object name is Convention_Attendee__c, the share object will be created as Convention_Attendee__share because the Organization-Wide Default sharing setting was set to private.
From the above table, we know that to create a record for the Convention_Attendee__share object, we need to assign ParentId, which is the Id of the record being shared. (Id of Convention_Attendee__c record in this scenario)
Now, coming back to the options given, the correct answer is:
Option Create an After-Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is correct because we need to Set the ID of the record being shared which we can only have in After Trigger Context.
Option Create a Before Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is not correct in Before Trigger, we do not have the Id of record being shared.
Reference & code example: https://developer.salesforce.com/docs/atlas.en-us.204.0.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm
Unattempted
This is a scenario-based question that is related to Sharing a record using Apex.
The scenario given in this question is:
There is a private sharing model for the Convention_Attendee__c custom object.
o Please Note: Since the sharing model is private. The Non Owner should not be able to view the Convention_Attendee__c custom object record.
There is a field Event_Reviewer__c on the custom object having lookup to the User.
Requirement
Event Reviewer to automatically gain Read/Write access to every record they are assigned to. That means, when the record of Convention Attendee custom object is created, the associated user should also get the Read/Write access.
Criteria-Based Sharing Rules
A criteria-based sharing rule determines with whom to share records based on field values. But in the scenario given in this question, the criteria is not universal so we can not use it. Therefore we need to use Apex.
Sharing a Record Using Apex
To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. All custom object sharing objects are named as follows:
Name of custom object = MyCustomObject
Name of share object = MyCustomObject__Share
Every share object has the following properties:
Now, coming back to the question:
Since the custom object name is Convention_Attendee__c, the share object will be created as Convention_Attendee__share because the Organization-Wide Default sharing setting was set to private.
From the above table, we know that to create a record for the Convention_Attendee__share object, we need to assign ParentId, which is the Id of the record being shared. (Id of Convention_Attendee__c record in this scenario)
Now, coming back to the options given, the correct answer is:
Option Create an After-Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is correct because we need to Set the ID of the record being shared which we can only have in After Trigger Context.
Option Create a Before Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing is not correct in Before Trigger, we do not have the Id of record being shared.
Reference & code example: https://developer.salesforce.com/docs/atlas.en-us.204.0.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm
Question 53 of 58
53. Question
A company represents its customers as Accounts in Salesforce. All customers have a unique customer_number__c that is unique across all of the company‘s systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time. What is the optimal way to implement this?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 54 of 58
54. Question
A Visualforce page needs to make a callout to get building information and tax information from two different REST endpoints. The information needs to be displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process. How should a developer implement the callouts?
Correct
A newly added scenario and an explanation will be added in a couple of weeks.
Incorrect
A newly added scenario and an explanation will be added in a couple of weeks.
Unattempted
A newly added scenario and an explanation will be added in a couple of weeks.
Question 55 of 58
55. Question
Refer to the code snippet below:
As part of an integration development effort, a developer is tasked to create an Apex method that solely relies on the use of foreign identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as an external ID, the API Name of this field is Legacy_Id_c.
What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?
Correct
This is a scenario-based question that is related to the concept of External Id in Salesforce.
External Id in Salesforce
An External Id is a custom field that has the External ID attribute, meaning that it contains unique record identifiers from a system outside of Salesforce.
Now, lets understand the scenario given in this question:
The Account object in Salesforce contains a field marked as External Id. The API name of this field is Legacy_Id__c.
There is a need to write Apex Method that relates new Contact records to existing Accounts in Salesforce. The sample code given in this question is:
The ask is:
What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?
Lets understand this by an example. We created a field on Account Object called Legacy_Id__c and written an Apex Method to create new Contact and associate the Contact with Account.
Screenshot Created External Id field on Account Object
Screenshot Created Apex Class
With the above Apex Code, we can see that:
The Account is instantiated based on the Legacy_Id__c field which is an external identifier.
With this explanation, the correct answer is:
Option Account parentAccount = new Account (Legacy_Id_c = externalIdentifier) is correct.
Incorrect
This is a scenario-based question that is related to the concept of External Id in Salesforce.
External Id in Salesforce
An External Id is a custom field that has the External ID attribute, meaning that it contains unique record identifiers from a system outside of Salesforce.
Now, lets understand the scenario given in this question:
The Account object in Salesforce contains a field marked as External Id. The API name of this field is Legacy_Id__c.
There is a need to write Apex Method that relates new Contact records to existing Accounts in Salesforce. The sample code given in this question is:
The ask is:
What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?
Lets understand this by an example. We created a field on Account Object called Legacy_Id__c and written an Apex Method to create new Contact and associate the Contact with Account.
Screenshot Created External Id field on Account Object
Screenshot Created Apex Class
With the above Apex Code, we can see that:
The Account is instantiated based on the Legacy_Id__c field which is an external identifier.
With this explanation, the correct answer is:
Option Account parentAccount = new Account (Legacy_Id_c = externalIdentifier) is correct.
Unattempted
This is a scenario-based question that is related to the concept of External Id in Salesforce.
External Id in Salesforce
An External Id is a custom field that has the External ID attribute, meaning that it contains unique record identifiers from a system outside of Salesforce.
Now, lets understand the scenario given in this question:
The Account object in Salesforce contains a field marked as External Id. The API name of this field is Legacy_Id__c.
There is a need to write Apex Method that relates new Contact records to existing Accounts in Salesforce. The sample code given in this question is:
The ask is:
What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?
Lets understand this by an example. We created a field on Account Object called Legacy_Id__c and written an Apex Method to create new Contact and associate the Contact with Account.
Screenshot Created External Id field on Account Object
Screenshot Created Apex Class
With the above Apex Code, we can see that:
The Account is instantiated based on the Legacy_Id__c field which is an external identifier.
With this explanation, the correct answer is:
Option Account parentAccount = new Account (Legacy_Id_c = externalIdentifier) is correct.
Question 56 of 58
56. Question
An Apex trigger and Apex class increment a counter, Edit_Count__c, any time that the Case is changed.
A new process on the Case object was just created in production for when a Case is created or updated. Since the process was created, there are reports that the Edit Count is being incremented by more than one on Case edit.
Which change in the Apex code will fix the problem?
Correct
This question is related to the concept of Recursive Trigger in Salesforce. The scenario given in this question is:
There is a trigger class to increment a counter Edit_Count__c, any time that the Case is changed.
After a new Process is created, it seems Edit Count is being incremented by more than one on Case edits.
Handle Recursion in Trigger
To avoid the recursion on a trigger, make sure your trigger is getting executed only one time. You can use Static Boolean variable in apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
Screenshot Apex Class having Boolean Variable
Now, we can use this Boolean variable in the Trigger before calling the apex method and then update the Boolean variable value to false.
With this explanation, lets find the correct answers from the options given.
The below Option is CORRECT because it added the static Boolean variable to the apex class.
The below option is CORRECT because it uses the Boolean variable before calling the Apex Methods.
This question is related to the concept of Recursive Trigger in Salesforce. The scenario given in this question is:
There is a trigger class to increment a counter Edit_Count__c, any time that the Case is changed.
After a new Process is created, it seems Edit Count is being incremented by more than one on Case edits.
Handle Recursion in Trigger
To avoid the recursion on a trigger, make sure your trigger is getting executed only one time. You can use Static Boolean variable in apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
Screenshot Apex Class having Boolean Variable
Now, we can use this Boolean variable in the Trigger before calling the apex method and then update the Boolean variable value to false.
With this explanation, lets find the correct answers from the options given.
The below Option is CORRECT because it added the static Boolean variable to the apex class.
The below option is CORRECT because it uses the Boolean variable before calling the Apex Methods.
This question is related to the concept of Recursive Trigger in Salesforce. The scenario given in this question is:
There is a trigger class to increment a counter Edit_Count__c, any time that the Case is changed.
After a new Process is created, it seems Edit Count is being incremented by more than one on Case edits.
Handle Recursion in Trigger
To avoid the recursion on a trigger, make sure your trigger is getting executed only one time. You can use Static Boolean variable in apex class and check the variable in Apex Trigger IF it is true then execute your logic and make it false so that trigger cannot execute Again.
Screenshot Apex Class having Boolean Variable
Now, we can use this Boolean variable in the Trigger before calling the apex method and then update the Boolean variable value to false.
With this explanation, lets find the correct answers from the options given.
The below Option is CORRECT because it added the static Boolean variable to the apex class.
The below option is CORRECT because it uses the Boolean variable before calling the Apex Methods.
A developer is tasked with creating an application-centric feature on which end-users can access and update information. This feature must be available in Lightning Experience while working seamlessly in multiple device form factors, such as desktops, phones, and tablets. Additionally, the feature must support Addressable URL Tabs and interact with the Salesforce Console APIs. What are two approaches a developer can take to build the application and support the business requirements? Choose 2 answers.
Correct
This is a scenario-based question related to developing Lightning Components. The scenario/requirement given in this question is: The implementation should work in multiple device form factors, such as desktops, phones, and tablets. The implementation must support Addressable URL Tabs and interact with the Salesforce Console APIs. For the second point, To enable direct navigation to a Lightning component via URL, add the lightning:isUrlAddressable interface to the component. But this is not supported in Lightning Web Components. Therefore, we can implement this in two ways: Either use Aura Component or Use Lightning Web Component wrapped inside Aura Component so that the parent Aura Component can be used to achieve Addressable URL functionality. With this explanation, the correct answers are: Option Create the application using Aura Components is correct. Option Create the application using Lightning Web Components wrapped in Aura Components. is correct Reference: https://developer.salesforce.com/docs/component-library/bundle/lightning:isUrlAddressable/documentation
Incorrect
This is a scenario-based question related to developing Lightning Components. The scenario/requirement given in this question is: The implementation should work in multiple device form factors, such as desktops, phones, and tablets. The implementation must support Addressable URL Tabs and interact with the Salesforce Console APIs. For the second point, To enable direct navigation to a Lightning component via URL, add the lightning:isUrlAddressable interface to the component. But this is not supported in Lightning Web Components. Therefore, we can implement this in two ways: Either use Aura Component or Use Lightning Web Component wrapped inside Aura Component so that the parent Aura Component can be used to achieve Addressable URL functionality. With this explanation, the correct answers are: Option Create the application using Aura Components is correct. Option Create the application using Lightning Web Components wrapped in Aura Components. is correct Reference: https://developer.salesforce.com/docs/component-library/bundle/lightning:isUrlAddressable/documentation
Unattempted
This is a scenario-based question related to developing Lightning Components. The scenario/requirement given in this question is: The implementation should work in multiple device form factors, such as desktops, phones, and tablets. The implementation must support Addressable URL Tabs and interact with the Salesforce Console APIs. For the second point, To enable direct navigation to a Lightning component via URL, add the lightning:isUrlAddressable interface to the component. But this is not supported in Lightning Web Components. Therefore, we can implement this in two ways: Either use Aura Component or Use Lightning Web Component wrapped inside Aura Component so that the parent Aura Component can be used to achieve Addressable URL functionality. With this explanation, the correct answers are: Option Create the application using Aura Components is correct. Option Create the application using Lightning Web Components wrapped in Aura Components. is correct Reference: https://developer.salesforce.com/docs/component-library/bundle/lightning:isUrlAddressable/documentation
Question 58 of 58
58. Question
Which scenario requires a developer to use an Apex callout instead of Outbound Messaging?
Correct
This is a scenario-based question that is related to using Apex and Outbound Messaging for the callout to an external system. Salesforce provides the following features to implement Integration: Apex Callout Outbound Messaging (OM) It is very important that we fully understand the capabilities of these features and then decide on a suitable approach. 1. Apex Callout: Enable Apex to invoke external web services. This allows you to connect to 3rd party web services such as Google, Amazon, Facebook, and any other external web service. Callout requires familiarity with Apex coding Transaction failure & retry logic should be explicitly coded Supports both SOAP & REST API Invocation Sync & Async requests handling is supported 2. Outbound Messages: OM can be implemented using Point & Click tools without having to write any code in Salesforce. Sends configured fields in the form of the XML SOAP message to the specified end-point. The destination endpoint should be setup in a specific way for it to accept the contents of the SOAP message being sent. We wont be able to use the existing web services of the Target system. We can only send single parent record fields in the SOAP message. Additional web service transactions should be issued back to Salesforce (from custom solution) using the session id sent in the SOAP message to get additional (related) records. Now, coming back to the question, it says in which scenario we need to use Apex Callout instead of Outbound Messages. Option The callout needs to be invoked from a Workflow Rule is NOT CORRECT because we can use Apex Callout from the workflow rule. Option The target system uses a SOAP API is NOT CORRECT because if the target system uses SOAP API, we can use both Apex Callout as well as Outbound Message. Option The callout needs to be asynchronous is NOT CORRECT because for this scenario also, we can use either Apex or Outbound Message. Option The target system uses a REST API is CORRECT because for this situation, we should only use Apex Callout.
Incorrect
This is a scenario-based question that is related to using Apex and Outbound Messaging for the callout to an external system. Salesforce provides the following features to implement Integration: Apex Callout Outbound Messaging (OM) It is very important that we fully understand the capabilities of these features and then decide on a suitable approach. 1. Apex Callout: Enable Apex to invoke external web services. This allows you to connect to 3rd party web services such as Google, Amazon, Facebook, and any other external web service. Callout requires familiarity with Apex coding Transaction failure & retry logic should be explicitly coded Supports both SOAP & REST API Invocation Sync & Async requests handling is supported 2. Outbound Messages: OM can be implemented using Point & Click tools without having to write any code in Salesforce. Sends configured fields in the form of the XML SOAP message to the specified end-point. The destination endpoint should be setup in a specific way for it to accept the contents of the SOAP message being sent. We wont be able to use the existing web services of the Target system. We can only send single parent record fields in the SOAP message. Additional web service transactions should be issued back to Salesforce (from custom solution) using the session id sent in the SOAP message to get additional (related) records. Now, coming back to the question, it says in which scenario we need to use Apex Callout instead of Outbound Messages. Option The callout needs to be invoked from a Workflow Rule is NOT CORRECT because we can use Apex Callout from the workflow rule. Option The target system uses a SOAP API is NOT CORRECT because if the target system uses SOAP API, we can use both Apex Callout as well as Outbound Message. Option The callout needs to be asynchronous is NOT CORRECT because for this scenario also, we can use either Apex or Outbound Message. Option The target system uses a REST API is CORRECT because for this situation, we should only use Apex Callout.
Unattempted
This is a scenario-based question that is related to using Apex and Outbound Messaging for the callout to an external system. Salesforce provides the following features to implement Integration: Apex Callout Outbound Messaging (OM) It is very important that we fully understand the capabilities of these features and then decide on a suitable approach. 1. Apex Callout: Enable Apex to invoke external web services. This allows you to connect to 3rd party web services such as Google, Amazon, Facebook, and any other external web service. Callout requires familiarity with Apex coding Transaction failure & retry logic should be explicitly coded Supports both SOAP & REST API Invocation Sync & Async requests handling is supported 2. Outbound Messages: OM can be implemented using Point & Click tools without having to write any code in Salesforce. Sends configured fields in the form of the XML SOAP message to the specified end-point. The destination endpoint should be setup in a specific way for it to accept the contents of the SOAP message being sent. We wont be able to use the existing web services of the Target system. We can only send single parent record fields in the SOAP message. Additional web service transactions should be issued back to Salesforce (from custom solution) using the session id sent in the SOAP message to get additional (related) records. Now, coming back to the question, it says in which scenario we need to use Apex Callout instead of Outbound Messages. Option The callout needs to be invoked from a Workflow Rule is NOT CORRECT because we can use Apex Callout from the workflow rule. Option The target system uses a SOAP API is NOT CORRECT because if the target system uses SOAP API, we can use both Apex Callout as well as Outbound Message. Option The callout needs to be asynchronous is NOT CORRECT because for this scenario also, we can use either Apex or Outbound Message. Option The target system uses a REST API is CORRECT because for this situation, we should only use Apex Callout.
X
Use Page numbers below to navigate to other practice tests