Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 26


A developer wants to call an Apex Server-side Controller from a Lightning Aura Component.

What are two limitations to the data being returned by the Controller? (Choose two.)

Show Answer
Correct Answer: ACD

A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned. Additionally, only basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components. Lists of custom Apex classes can also be returned under these conditions, making options A and D correct.

Discussion

9 comments
Sign in to comment
levianOptions: AC
Sep 29, 2022

C and A for me is correct,

ChiaSamOptions: AD
Jun 13, 2022

as sObject is also supported

Ike300Options: AC
Apr 7, 2023

Return data types can be any of the following. Simple—String, Integer, and so on. See Basic Types for details. sObject—standard and custom sObjects are both supported. See Standard and Custom Object Types. Apex—an instance of an Apex class. (Most often a custom class.) See Custom Apex Class Types. You can’t use an Apex inner class as a return value for an Apex method that's called by an Aura component. Collection—a collection of any of the other types. See Collection Types.

Ike300
Apr 7, 2023

D is not correct since it mentioned ONLY 2

moitamOptions: AD
Aug 23, 2023

According to the documentation: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_returning_data.htm Results data from an Apex server-side controller must be serializable into JSON format. This means that only basic data types and sObjects are supported as return types for Apex controllers called by Lightning Aura Components. Lists of custom Apex classes can also be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned. In this case, the correct answers are A and D

AnjindalOptions: AD
May 21, 2024

Correct Ans A & D

Liquad
Sep 26, 2021

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_returning_data.htm

ChiaSamOptions: AD
Jun 13, 2022

Answer should be A and D as sObject is also supported.

test_1510_1Options: AC
Oct 15, 2022

@AuraEnabled is required for wrapper class properties

santo_ajOptions: AC
May 2, 2023

A&C it's ok https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_returning_data.htm