Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 222


Refer to the markup below:

Exam Certified Platform Developer II Question 222

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?

Show Answer
Correct Answer: D

To improve the performance of the Lightning web component, the developer should replace layout-type="Full" with fields={fields}. This approach allows the developer to retrieve only the specific fields that the component needs rather than fetching all the fields defined in the full layout. By loading only the necessary fields, the amount of data to be retrieved and processed is minimized, leading to better performance.

Discussion

4 comments
Sign in to comment
AppleDash
May 31, 2024

Should be D.

[Removed]Option: D
Aug 24, 2024

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.

Sapphire808
Sep 24, 2024

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

Genki_SugisakiOption: C
Feb 25, 2024

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.

Segre
Mar 13, 2024

actually, cacheable=true annotation is added to the method, not a component.