Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 299 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 299
Topic #: 1
[All Certified Platform Developer II Questions]

Refer to the markup below:



A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly.

What can the developer do to improve the performance?

  • A. Add density="compact" to the component.
  • B. Replace layout-type="Full" with layout-type="Partial".
  • C. Add cache="true" to the component.
  • D. Replace layouts-type="Full" with fields={fields}.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Sapphire808
1 year, 1 month ago
D. In the "Specifying Record Fields" section of the documentation provided, it says that fields can be specified with the layout-type or fields attribute, but layout-type only has two options (full or compact) therefore if the option were layout-type = "compact" then that would make more sense but since it is not, I would go with D where the layout-type is replaces with fields = {fields} since compact is in reference to the compact layout defined in the compact page layout in setup. https://developer.salesforce.com/docs/component-library/bundle/lightning-record-form/documentation
upvoted 2 times
...
[Removed]
1 year, 2 months ago
Selected Answer: D
By using the "fields" attribute, we can retrieve only specific fields. Retrieving only the fields that the component requires helps avoid unnecessary field retrievals and improves performance. This option is a suitable way to enhance component performance. Therefore, the correct answer should be D.
upvoted 2 times
...
AppleDash
1 year, 5 months ago
Should be D.
upvoted 3 times
...
Genki_Sugisaki
1 year, 8 months ago
Selected Answer: C
This will enable caching of the component's data and improve performance by reducing the amount of data that needs to be fetched from the server on subsequent loads of the component.
upvoted 1 times
Segre
1 year, 8 months ago
actually, cacheable=true annotation is added to the method, not a component.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...